Fixed unitwalkto calls in unit walk events (#2913)

* Fixes #2341.
* Fixed unitkill for mobs inside the walk event.
* Also fixed the state tracking of the walk event script.
Thanks to @Atemo!
This commit is contained in:
Lemongrass3110
2018-02-27 19:33:12 +01:00
committed by Aleos
parent 7188619325
commit a0a55dada1
2 changed files with 34 additions and 6 deletions

View File

@@ -3043,8 +3043,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
if(!md->spawn) //Tell status_damage to remove it from memory.
return 5; // Note: Actually, it's 4. Oh well...
if(!md->spawn){ //Tell status_damage to remove it from memory.
struct unit_data *ud = unit_bl2ud(&md->bl);
// If the unit is currently in a walk script, it will be removed there
return ud->state.walk_script ? 3 : 5; // Note: Actually, it's 4. Oh well...
}
// MvP tomb [GreenBox]
if (battle_config.mvp_tomb_enabled && md->spawn->state.boss && map[md->bl.m].flag.notomb != 1)