diff options
author | epoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-13 02:55:36 +0000 |
---|---|---|
committer | epoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-13 02:55:36 +0000 |
commit | 9b24ab2cffb38d283ea1c68c961507db0d86f7de (patch) | |
tree | 48d0e6aa53c7798f51d557717d348d2f1cca04ee /src/map/skill.c | |
parent | 0fe7b873ae06352aba2840eacf687d270d64fc2d (diff) | |
download | hercules-9b24ab2cffb38d283ea1c68c961507db0d86f7de.tar.gz hercules-9b24ab2cffb38d283ea1c68c961507db0d86f7de.tar.bz2 hercules-9b24ab2cffb38d283ea1c68c961507db0d86f7de.tar.xz hercules-9b24ab2cffb38d283ea1c68c961507db0d86f7de.zip |
- Optimised the guild aura routine which was wasting cycles by processing every unit on a map (rather than guild members)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15084 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index a7e75b6f4..1847ffb86 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2382,27 +2382,18 @@ static int skill_check_unit_range2 (struct block_list *bl, int x, int y, int ski type, skillid); } -int skill_guildaura_sub (struct block_list *bl, va_list ap) +int skill_guildaura_sub (struct map_session_data* sd, int id, int gid, int strvit, int agidex) { - struct map_session_data *sd; - int gid, id, strvit, agidex; - - sd = (struct map_session_data *)bl; + nullpo_ret(sd); - id = va_arg(ap,int); - gid = va_arg(ap,int); - if (sd->status.guild_id != gid) + if( sd->status.guild_id != gid ) return 0; - - if(id == sd->bl.id && battle_config.guild_aura&16) + if( id == sd->bl.id && battle_config.guild_aura&16 ) return 0; - strvit = va_arg(ap,int); - agidex = va_arg(ap,int); - - if (sd->sc.data[SC_GUILDAURA]) { + if( sd->sc.data[SC_GUILDAURA] ) { struct status_change_entry *sce = sd->sc.data[SC_GUILDAURA]; - if (sce->val3 != strvit || sce->val4 != agidex) { + if( sce->val3 != strvit || sce->val4 != agidex ) { sce->val3 = strvit; sce->val4 = agidex; status_calc_bl(&sd->bl, StatusChangeFlagTable[SC_GUILDAURA]); |