diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-26 16:48:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-26 20:27:14 +0300 |
commit | 7cc1daf0c11cddce59392263e19eefed42ee6e3a (patch) | |
tree | e3cc1e039917dfa67b21de1bf7ba2fab1176ceb7 /src | |
parent | a576c4effdb7b79d7db9b3a178d6e811a7ae82c2 (diff) | |
download | hercules-7cc1daf0c11cddce59392263e19eefed42ee6e3a.tar.gz hercules-7cc1daf0c11cddce59392263e19eefed42ee6e3a.tar.bz2 hercules-7cc1daf0c11cddce59392263e19eefed42ee6e3a.tar.xz hercules-7cc1daf0c11cddce59392263e19eefed42ee6e3a.zip |
Fix compilation errors and possible server crash from previous commits.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.h | 3 | ||||
-rw-r--r-- | src/map/pc.h | 4 | ||||
-rw-r--r-- | src/map/skill.c | 6 | ||||
-rw-r--r-- | src/map/status.c | 3 |
4 files changed, 10 insertions, 6 deletions
diff --git a/src/map/map.h b/src/map/map.h index 1374c61fe..9a5fa8ba3 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -301,7 +301,8 @@ enum { SPIRITS_TYPE_CHARM_LAND, SPIRITS_TYPE_CHARM_FIRE, SPIRITS_TYPE_CHARM_WIND, - SPIRITS_TYPE_SPHERE + SPIRITS_TYPE_SPHERE, + SPIRITS_TYPE_END }; enum auto_trigger_flag { diff --git a/src/map/pc.h b/src/map/pc.h index 641a8ee7c..8472eb34e 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -366,8 +366,8 @@ struct map_session_data { short catch_target_class; // pet catching, stores a pet class to catch (short now) [zzo] short spiritball, spiritball_old; int spirit_timer[MAX_SPIRITBALL]; - short spiritcharm[SPIRITS_TYPE_SPHERE]; - int charm_timer[SPIRITS_TYPE_SPHERE][MAX_SPIRITCHARM]; + short spiritcharm[SPIRITS_TYPE_END]; + int charm_timer[SPIRITS_TYPE_END][MAX_SPIRITCHARM]; unsigned char potion_success_counter; //Potion successes in row counter unsigned char mission_count; //Stores the bounty kill count for TK_MISSION short mission_mobid; //Stores the target mob_id for TK_MISSION diff --git a/src/map/skill.c b/src/map/skill.c index e70625866..ebcb31680 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6041,6 +6041,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case MO_ABSORBSPIRITS: { int sp = 0; + int i; if ( dstsd && dstsd->spiritball && (sd == dstsd || map_flag_vs(src->m) || (sd->duel_group && sd->duel_group == dstsd->duel_group)) && ((dstsd->class_&MAPID_BASEMASK) != MAPID_GUNSLINGER || (dstsd->class_&MAPID_UPPERMASK) != MAPID_REBELLION) @@ -6054,7 +6055,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin mob->target(dstmd,src,0); } if ( dstsd ) { - for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ ) + for (i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++) pc->del_charm(dstsd, dstsd->spiritcharm[i], i); } if (sp) status->heal(src, 0, sp, 3); @@ -8922,7 +8923,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin status_percent_heal(src, 0, sp); } if ( dstsd ) { - for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ ) + int i; + for (i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++) pc->del_charm(dstsd, dstsd->spiritcharm[i], i); } clif->skill_nodamage(src, bl, skill_id, skill_lv, sp ? 1:0); diff --git a/src/map/status.c b/src/map/status.c index 3c2aeb939..d3fa25aaa 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8636,8 +8636,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC__ENERVATION: val2 = 20 + 10 * val1; // ATK Reduction if ( sd ) { + int i; pc->delspiritball(sd, sd->spiritball, 0); - for ( int i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++ ) + for (i = SPIRITS_TYPE_CHARM_WATER; i < SPIRITS_TYPE_SPHERE; i++) pc->del_charm(sd, sd->spiritcharm[i], i); } break; |