diff options
author | Test_User <hax@andrewyu.org> | 2024-05-16 23:10:54 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-05-16 23:10:54 -0300 |
commit | d4cc62d5a1497a0bdf600792a151a1f3fad52e38 (patch) | |
tree | 845025f97577fcb0223f1c855f86c41b9a6a70df /src | |
parent | cf3cf651ec1f0e5f13b4ad62836b4c6c12ab7326 (diff) | |
download | evol-hercules-d4cc62d5a1497a0bdf600792a151a1f3fad52e38.tar.gz evol-hercules-d4cc62d5a1497a0bdf600792a151a1f3fad52e38.tar.bz2 evol-hercules-d4cc62d5a1497a0bdf600792a151a1f3fad52e38.tar.xz evol-hercules-d4cc62d5a1497a0bdf600792a151a1f3fad52e38.zip |
so yeah sd also needs cecked for null
and you can drop the earlier *srcPtr null check
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/mob.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/emap/mob.c b/src/emap/mob.c index 04507a2..81f8435 100644 --- a/src/emap/mob.c +++ b/src/emap/mob.c @@ -343,23 +343,16 @@ int emob_dead_pre(struct mob_data **mdPtr, sprintf(name, "mob_spawn_%d_%d", m, md->bl.id); map->iwall_remove(name); } - // FIXME: Check if srcPtr is not null, THEN try this code - ///////////////////////////////////////////////////////////////////////// - // Program terminated with signal SIGSEGV, Segmentation fault. - // i#0 emob_dead_pre (mdPtr=<optimized out>, srcPtr=0x7ffcd5622190, typePtr=0x7ffcd562218c) at ../../src/emap/mob.c:351 - // 351 if (sd->sc.data && sd->sc.data[SC_BOTTER_SYNDROME]) { - ///////////////////////////////////////////////////////////////////////// - /* - if (srcPtr && *srcPtr) { + // Check for effects from the source + if (srcPtr) { // If Botter Syndrome is active, mob may randomly get NODROP // Aka *typePtr |= 1 struct map_session_data *sd = BL_CAST(BL_PC, *srcPtr); - if (sd->sc.data && sd->sc.data[SC_BOTTER_SYNDROME]) { + if (sd && sd->sc.data && sd->sc.data[SC_BOTTER_SYNDROME]) { if (rnd()%100 < sd->sc.data[SC_BOTTER_SYNDROME]->val1) *typePtr = *typePtr | 1; } } - */ } return 3; } |