Browse Source

Fixed bugreport:6864 where casting WM_GLOOMYDAY to mobs causes map crash.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16865 54d463be-8e91-2dee-dedb-b68131a5f0ec
rud0lp20 12 years ago
parent
commit
7bb8c706d2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/map/status.c

+ 1 - 1
src/map/status.c

@@ -8085,7 +8085,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
 		case SC_GLOOMYDAY:
 			val2 = 20 + 5 * val1; // Flee reduction.
 			val3 = 15 + 5 * val1; // ASPD reduction.
-			if( rand()%100 < val1 ){ // (Skill Lv) %
+			if( sd && rand()%100 < val1 ){ // (Skill Lv) %
 				val4 = 1; // reduce walk speed by half.
 				if( pc_isriding(sd) ) pc_setriding(sd, 0);
 				if( pc_isridingdragon(sd) ) pc_setoption(sd, sd->sc.option&~OPTION_DRAGON);