summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 17:06:55 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 17:06:55 +0000
commit4ef11952653e142f8a6f28194fa56eb615860339 (patch)
tree2394b1305c05356141a2d57d2ad147f4f4d87d07 /src/map/unit.c
parenta1276b3c3d519ec9ec839ba17027cc037484c014 (diff)
downloadhercules-4ef11952653e142f8a6f28194fa56eb615860339.tar.gz
hercules-4ef11952653e142f8a6f28194fa56eb615860339.tar.bz2
hercules-4ef11952653e142f8a6f28194fa56eb615860339.tar.xz
hercules-4ef11952653e142f8a6f28194fa56eb615860339.zip
- Removed the on-die specific code from unit_remove_map and placed it on the corresponding *_dead functions. unit_remove_map should never assume the char died, it is just a "remove from map" function.
- Updated status_damage to handle the general death code (clearing status changes, clearing skill related data, sending death packet, etc). The return value from the *_dead functions will tell it what to do or not with the object (death aborted, clear it from map/memory, etc) - Cleaned up pc_dead to take advantage of the fact that status changes are not ended until after the function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6852 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 02a95fd34..78e403aea 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1433,6 +1433,7 @@ int unit_changeviewsize(struct block_list *bl,short size)
* Returns 1 on success. 0 if it couldn't be removed or the bl was free'd
* if clrtype is 1 (death), appropiate cleanup is performed.
* Otherwise it is assumed bl is being warped.
+ * On-Kill specific stuff is not performed here, look at status_damage for that.
*------------------------------------------
*/
int unit_remove_map(struct block_list *bl, int clrtype) {
@@ -1455,9 +1456,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
ud->attackabletime = ud->canmove_tick = ud->canact_tick = gettick();
clif_clearchar_area(bl,clrtype);
- if (clrtype == 1) //Death. Remove all status changes.
- status_change_clear(bl,0);
- else if(sc && sc->count ) { //map-change/warp dispells.
+ if(sc && sc->count ) { //map-change/warp dispells.
if(sc->data[SC_BLADESTOP].timer!=-1)
status_change_end(bl,SC_BLADESTOP,-1);
if(sc->data[SC_BASILICA].timer!=-1)
@@ -1488,9 +1487,6 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
status_change_end(bl, SC_GOSPEL, -1);
}
- if (clrtype == 1 && battle_config.clear_unit_ondeath && //Clrtype 1 = died.
- battle_config.clear_unit_ondeath&bl->type)
- skill_clear_unitgroup(bl); // スキルユニットグループの削除
if (bl->type&BL_CHAR) {
skill_unit_move(bl,gettick(),4);
skill_cleartimerskill(bl); // タイマースキルクリア
@@ -1537,25 +1533,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
struct mob_data *md = (struct mob_data*)bl;
md->target_id=0;
md->attacked_id=0;
- md->state.skillstate= clrtype==1?MSS_DEAD:MSS_IDLE;
- if (md->master_id) md->master_dist = 0;
- if (clrtype == 1) { //Death.
- md->last_deadtime=gettick();
- if(md->deletetimer!=-1)
- delete_timer(md->deletetimer,mob_timer_delete);
- md->deletetimer=-1;
- if(pcdb_checkid(md->vd->class_)) //Player mobs are not removed automatically by the client.
- clif_clearchar_delay(gettick()+3000,bl,0);
- mob_deleteslave(md);
-
- if(!md->spawn) {
- map_delblock(bl);
- unit_free(bl); //Mob does not respawn.
- map_freeblock_unlock();
- return 0;
- }
- mob_setdelayspawn(md); //Set respawning.
- }
+ md->state.skillstate= MSS_IDLE;
} else if (bl->type == BL_PET) {
struct pet_data *pd = (struct pet_data*)bl;
struct map_session_data *sd = pd->msd;