Kaynağa Gözat

Fixed bug:7231 that if using pets, crashes the map-server.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17113 54d463be-8e91-2dee-dedb-b68131a5f0ec
ediejohnny 12 yıl önce
ebeveyn
işleme
97de5aaf85
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      src/map/unit.c

+ 2 - 2
src/map/unit.c

@@ -350,7 +350,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
 		map_random_dir(bl, &ud->to_x, &ud->to_y);
 
 	if(ud->walktimer != INVALID_TIMER) {
-		if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+		if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
 		return 0;
 		// When you come to the center of the grid because the change of destination while you're walking right now
 		// Call a function from a timer unit_walktoxy_sub
@@ -427,7 +427,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
 		map_random_dir(bl, &ud->to_x, &ud->to_y);
 
 	if(ud->walktimer != INVALID_TIMER) {
-		if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+		if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
 		return 0;
 		ud->state.change_walk_target = 1;
 		set_mobstate(bl, flag&2);