diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-29 14:18:20 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-29 14:18:20 +0000 |
commit | f648da19a914152a6d772f377dda110fa9248972 (patch) | |
tree | 96269103f190eb9c9ed656ad507104258c864b87 /src/map/status.c | |
parent | 042e3e0119641774c456d1c14e70f33d0609a491 (diff) | |
download | hercules-f648da19a914152a6d772f377dda110fa9248972.tar.gz hercules-f648da19a914152a6d772f377dda110fa9248972.tar.bz2 hercules-f648da19a914152a6d772f377dda110fa9248972.tar.xz hercules-f648da19a914152a6d772f377dda110fa9248972.zip |
- Some cleaning on the homunc speed calculating code, so that it correctly uses the default walk speed if the player has no speed yet.
- Some speed up code when loading status changes (use a pointer instead of memcpy'ing all the time)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9359 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map/status.c b/src/map/status.c index 164c6f4e6..3b36944c1 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2364,10 +2364,11 @@ int status_calc_homunculus(struct homun_data *hd, int first) status->size = hd->homunculusDB->size ;
status->rhw.range = 1 + status->size;
status->mode = MD_CANMOVE|MD_CANATTACK|MD_ASSIST|MD_AGGRESSIVE|MD_CASTSENSOR;
- if (battle_config.slaves_inherit_speed && hd->master)
+ status->speed = DEFAULT_WALK_SPEED;
+ if (battle_config.slaves_inherit_speed&1 &&
+ hd->master && hd->master->state.auth) //Master needs be authed to have valid speed.
status->speed = status_get_speed(&hd->master->bl);
- else
- status->speed = DEFAULT_WALK_SPEED;
+
status->hp = 1;
status->sp = 1;
}
@@ -2849,7 +2850,10 @@ void status_calc_bl_sub_hom(struct homun_data *hd, unsigned long flag) //[orn] if(flag&SCB_MATK) //Hom Min Matk is always the same as Max Matk
status->matk_min = status->matk_max;
-
+
+ if(flag&SCB_SPEED && battle_config.slaves_inherit_speed&1 && hd->master)
+ status->speed = status_get_speed(&hd->master->bl);
+
if(flag&(SCB_ASPD|SCB_AGI|SCB_DEX)) {
flag|=SCB_ASPD;
|