summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-05-09 00:29:07 -0300
committerJesusaves <cpntb1@ymail.com>2024-05-09 00:29:07 -0300
commit922e5abe420fde529f7bcfc28695581026accb9b (patch)
treeccb3b2976191734a5dcadc211a56fa51ac18894d
parentce242a334015745f1c32029ef15473f778e38742 (diff)
downloadevol-hercules-922e5abe420fde529f7bcfc28695581026accb9b.tar.gz
evol-hercules-922e5abe420fde529f7bcfc28695581026accb9b.tar.bz2
evol-hercules-922e5abe420fde529f7bcfc28695581026accb9b.tar.xz
evol-hercules-922e5abe420fde529f7bcfc28695581026accb9b.zip
<\Test_User> looks like you'll need if (srcPtr && *srcPtr) { for that one
<\Test_User> BL_CAST will function if *srcPtr == NULL, but it'll also "return" NULL, which is then dereferenced in that code as sd
-rw-r--r--src/emap/mob.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/emap/mob.c b/src/emap/mob.c
index 0460aa5..11b7f9d 100644
--- a/src/emap/mob.c
+++ b/src/emap/mob.c
@@ -344,8 +344,7 @@ int emob_dead_pre(struct mob_data **mdPtr,
map->iwall_remove(name);
}
// FIXME: Check if srcPtr is not null, THEN try this code
- /*
- if (srcPtr) {
+ if (srcPtr && *srcPtr) {
// If Botter Syndrome is active, mob may randomly get NODROP
// Aka *typePtr |= 1
struct map_session_data *sd = BL_CAST(BL_PC, *srcPtr);
@@ -354,7 +353,6 @@ int emob_dead_pre(struct mob_data **mdPtr,
*typePtr = *typePtr | 1;
}
}
- */
}
return 3;
}