Fixed rebinding of mob view data for killed mobs
Fixes #2351 Thanks to @TesLA-Git
This commit is contained in:
parent
2d31bc3c43
commit
5fdebec3af
@ -5254,19 +5254,18 @@ static int mob_reload_sub( struct mob_data *md, va_list args ){
|
||||
// Relink the mob to the new database entry
|
||||
md->db = mob_db(md->mob_id);
|
||||
|
||||
if( md->bl.prev == NULL ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the view data was not overwritten manually
|
||||
if( !md->vd_changed ){
|
||||
// Get the new view data from the mob database
|
||||
md->vd = mob_get_viewdata(md->mob_id);
|
||||
|
||||
// If they are spawned right now
|
||||
if( md->bl.prev != NULL ){
|
||||
// Respawn all mobs on client side so that they are displayed correctly(if their view id changed)
|
||||
clif_clearunit_area(&md->bl, CLR_OUTSIGHT);
|
||||
clif_spawn(&md->bl);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -5278,19 +5277,18 @@ static int mob_reload_sub( struct mob_data *md, va_list args ){
|
||||
* @return 0
|
||||
*/
|
||||
static int mob_reload_sub_npc( struct npc_data *nd, va_list args ){
|
||||
if( nd->bl.prev == NULL ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the view data points to a mob
|
||||
if( mobdb_checkid(nd->class_) ){
|
||||
// Get the new view data from the mob database
|
||||
nd->vd = mob_get_viewdata(nd->class_);
|
||||
|
||||
// If they are spawned right now
|
||||
if( nd->bl.prev == NULL ){
|
||||
// Respawn all NPCs on client side so that they are displayed correctly(if their view id changed)
|
||||
clif_clearunit_area(&nd->bl, CLR_OUTSIGHT);
|
||||
clif_spawn(&nd->bl);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user