Browse Source

Fixed soul drain visual effect not being displayed to mobs, bugreport:2980

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15193 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 năm trước cách đây
mục cha
commit
f0e3ef3e2e
4 tập tin đã thay đổi với 16 bổ sung8 xóa
  1. 3 3
      src/map/clif.c
  2. 1 1
      src/map/clif.h
  3. 7 2
      src/map/mob.c
  4. 5 2
      src/map/unit.c

+ 3 - 3
src/map/clif.c

@@ -738,17 +738,17 @@ int clif_clearunit_area(struct block_list* bl, clr_type type)
 static int clif_clearunit_delayed_sub(int tid, unsigned int tick, int id, intptr_t data)
 {
 	struct block_list *bl = (struct block_list *)data;
-	clif_clearunit_area(bl, CLR_OUTSIGHT);
+	clif_clearunit_area(bl, (clr_type) id);
 	aFree(bl);
 	return 0;
 }
 
-int clif_clearunit_delayed(struct block_list* bl, unsigned int tick)
+int clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int tick)
 {
 	struct block_list *tbl;
 	tbl = (struct block_list*)aMalloc(sizeof (struct block_list));
 	memcpy (tbl, bl, sizeof (struct block_list));
-	add_timer(tick, clif_clearunit_delayed_sub, 0, (intptr_t)tbl);
+	add_timer(tick, clif_clearunit_delayed_sub, (int)type, (intptr_t)tbl);
 	return 0;
 }
 

+ 1 - 1
src/map/clif.h

@@ -231,7 +231,7 @@ int clif_clearflooritem(struct flooritem_data *,int);
 
 int clif_clearunit_single(int id, clr_type type, int fd);
 int clif_clearunit_area(struct block_list* bl, clr_type type);
-int clif_clearunit_delayed(struct block_list* bl, unsigned int tick);
+int clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int tick);
 int clif_spawn(struct block_list*);	//area
 int clif_walkok(struct map_session_data*);	// self
 void clif_move(struct unit_data *ud); //area

+ 7 - 2
src/map/mob.c

@@ -2458,8 +2458,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 
 	if(pcdb_checkid(md->vd->class_))
 	{	//Player mobs are not removed automatically by the client.
-		clif_clearunit_delayed(&md->bl, tick+3000);
-	}
+		clif_clearunit_delayed(&md->bl, CLR_OUTSIGHT,tick+3000);
+	} else
+		/**
+		 * We give the client some time to breath and this allows it to display anything it'd like with the dead corpose
+		 * For example, this delay allows it to display soul drain effect
+		 **/
+		clif_clearunit_delayed(&md->bl, CLR_DEAD, tick+250);
 
 	if(!md->spawn) //Tell status_damage to remove it from memory.
 		return 5; // Note: Actually, it's 4. Oh well...

+ 5 - 2
src/map/unit.c

@@ -2107,8 +2107,11 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
 	}
 	default: ;// do nothing
 	}
-
-	clif_clearunit_area(bl,clrtype);
+	/**
+	 * BL_MOB is handled by mob_dead
+	 **/
+	if( bl->type != BL_MOB )
+		clif_clearunit_area(bl,clrtype);
 	map_delblock(bl);
 	map_freeblock_unlock();
 	return 1;