Browse Source

Follow up 0be6389c4881ad7c06ad1a546909b8f934a81d8a.
* Fixed compile error, thanks to @anacondaqq

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 9 years ago
parent
commit
9643230521
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/map/script.c

+ 2 - 2
src/map/script.c

@@ -17174,11 +17174,11 @@ BUILDIN_FUNC(setunitdata)
 			case UMOB_LUK: md->status.luk = (unsigned short)value; status_calc_misc(bl, &md->status, md->level); break;
 			case UMOB_SLAVECPYMSTRMD:
 				if (value > 0) {
-					if (!md->master_id) {
+					TBL_MOB *md2 = NULL;
+					if (!md->master_id || !(md2 = map_id2md(md->master_id))) {
 						ShowWarning("buildin_setunitdata: Trying to set UMOB_SLAVECPYMSTRMD on mob without master!\n");
 						break;
 					}
-					TBL_MOB *md2 = map_id2md(md->master_id);
 					md->status.mode = md2->status.mode;
 					md->state.copy_master_mode = 1;
 				} else