Update homunc's speed when master's speed changes, should avoid homunc's speed = 0 on login (when homunc's stats are calculated before master's stats)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9110 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
toms 2006-10-31 16:24:17 +00:00
parent 4435ff8b9c
commit 3db5a31015
2 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/10/31 2006/10/31
* Update homunc's speed when master's speed changes, should avoid homunc's
speed = 0 on login (homunc's stats are calculated before master's stats) [Toms]
* When Kaizel (or super novice rebirth skill) triggers, you get debuffed * When Kaizel (or super novice rebirth skill) triggers, you get debuffed
now. [Skotlex] now. [Skotlex]
* Modified the player_cloak_check_type and monster_cloak_check_type * Modified the player_cloak_check_type and monster_cloak_check_type

View File

@ -2263,7 +2263,12 @@ int status_calc_pc(struct map_session_data* sd,int first)
if(memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill))) if(memcmp(b_skill,sd->status.skill,sizeof(sd->status.skill)))
clif_skillinfoblock(sd); clif_skillinfoblock(sd);
if(b_status.speed != status->speed) if(b_status.speed != status->speed)
{
clif_updatestatus(sd,SP_SPEED); clif_updatestatus(sd,SP_SPEED);
// If speed changes & slaves should inherits master's speed & master have homunc, update it
if (sd->hd && battle_config.slaves_inherit_speed)
status_calc_bl(&sd->hd->bl, SCB_SPEED);
}
if(b_weight != sd->weight) if(b_weight != sd->weight)
clif_updatestatus(sd,SP_WEIGHT); clif_updatestatus(sd,SP_WEIGHT);
if(b_max_weight != sd->max_weight) { if(b_max_weight != sd->max_weight) {
@ -2813,6 +2818,13 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn]
if(status->sp > status->max_sp) if(status->sp > status->max_sp)
status->sp = status->max_sp; status->sp = status->max_sp;
} }
if(flag&SCB_SPEED)
{
if (battle_config.slaves_inherit_speed && hd->master)
status->speed = status_get_speed(&hd->master->bl);
else
status->speed = DEFAULT_WALK_SPEED;
}
if(flag&SCB_INT) { if(flag&SCB_INT) {
flag|=SCB_MDEF; flag|=SCB_MDEF;
status->mdef += (status->int_/5 - b_status->int_/5); status->mdef += (status->int_/5 - b_status->int_/5);