diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-08 06:25:50 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-08 06:25:50 +0000 |
commit | 1811436903c5383e8f3eeacdd88bd7eece6c7998 (patch) | |
tree | b4a27aeffa94aba20353aaf7ae64b674407d37db /src | |
parent | 4f23ac6a3862cbf1b1cbd8bea240c9fdf9290937 (diff) | |
download | hercules-1811436903c5383e8f3eeacdd88bd7eece6c7998.tar.gz hercules-1811436903c5383e8f3eeacdd88bd7eece6c7998.tar.bz2 hercules-1811436903c5383e8f3eeacdd88bd7eece6c7998.tar.xz hercules-1811436903c5383e8f3eeacdd88bd7eece6c7998.zip |
- Likely fixed a mob not returning to their original class view on respawn after they changed class.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5952 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/mob.c | 7 | ||||
-rw-r--r-- | src/map/status.c | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index e917b4fd6..d237f4109 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -652,8 +652,8 @@ int mob_spawn (struct mob_data *md) md->last_spawntime = tick;
if (md->bl.prev != NULL)
unit_remove_map(&md->bl,2);
- else if (md->spawn && md->class_ != md->spawn->class_) {
- md->class_ = md->spawn->class_;
+ else if (md->vd->class_ != md->class_) {
+ status_set_viewdata(&md->bl, md->class_);
md->db = mob_db(md->class_);
md->speed=md->db->speed;
if (md->spawn)
@@ -2364,8 +2364,6 @@ int mob_class_change (struct mob_data *md, int class_) return 0;
hp_rate = md->hp*100/status_get_max_hp(&md->bl);
- clif_mob_class_change(md,class_);
- md->class_ = class_;
md->db = mob_db(class_);
md->max_hp = md->db->max_hp; //Update the mob's max HP
if (battle_config.monster_class_change_full_recover) {
@@ -2385,6 +2383,7 @@ int mob_class_change (struct mob_data *md, int class_) mob_stop_walking(md, 0);
unit_skillcastcancel(&md->bl, 0);
status_set_viewdata(&md->bl, class_);
+ clif_mob_class_change(md,class_);
for(i=0,c=tick-1000*3600*10;i<MAX_MOBSKILL;i++)
md->skilldelay[i] = c;
diff --git a/src/map/status.c b/src/map/status.c index 336b9165d..9b0dbfc03 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2329,8 +2329,8 @@ int status_quick_recalc_speed(struct map_session_data *sd, int skill_num, int sk int status_get_class(struct block_list *bl)
{
nullpo_retr(0, bl);
- if(bl->type==BL_MOB)
- return ((struct mob_data *)bl)->class_;
+ if(bl->type==BL_MOB) //Class used on all code should be the view class of the mob.
+ return ((struct mob_data *)bl)->vd->class_;
if(bl->type==BL_PC)
return ((struct map_session_data *)bl)->status.class_;
if(bl->type==BL_PET)
|