summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-01 18:36:27 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-01 18:36:27 +0000
commit8deb4dfef1f3a6b81a93af20eccc7026b308dcc0 (patch)
treeffca29d20b5f246146878c6daf0a616da7e29068 /src
parentf1586c89c9aed81d85d72ebbe0a0829f9a9237e9 (diff)
downloadhercules-8deb4dfef1f3a6b81a93af20eccc7026b308dcc0.tar.gz
hercules-8deb4dfef1f3a6b81a93af20eccc7026b308dcc0.tar.bz2
hercules-8deb4dfef1f3a6b81a93af20eccc7026b308dcc0.tar.xz
hercules-8deb4dfef1f3a6b81a93af20eccc7026b308dcc0.zip
* Fixed bAutoSpellOnSkill bonuses could not be chained (bugreport:4421, since r13596).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14536 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/skill.c17
2 files changed, 10 insertions, 9 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 4a9c17f3a..c6c6f4801 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -55,6 +55,7 @@ struct weapon_data {
struct s_autospell {
short id, lv, rate, card_id, flag;
+ bool lock; // bAutoSpellOnSkill: blocks autospell from triggering again, while being executed
};
struct s_addeffect {
@@ -134,7 +135,6 @@ struct map_session_data {
short pmap; // Previous map on Map Change
struct guild *gmaster_flag;
unsigned int bg_id;
- unsigned skillonskill : 1;
unsigned short user_font;
unsigned short autobonus; //flag to indicate if an autobonus is activated. [Inkfish]
} state;
diff --git a/src/map/skill.c b/src/map/skill.c
index dbdfbe35a..c1c9420e3 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1091,11 +1091,14 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
if( sd == NULL || skillid <= 0 )
return 0;
- sd->state.skillonskill = 1;
for( i = 0; i < ARRAYLENGTH(sd->autospell3) && sd->autospell3[i].flag; i++ )
{
if( sd->autospell3[i].flag != skillid )
continue;
+
+ if( sd->autospell3[i].lock )
+ continue; // autospell already being executed
+
skill = (sd->autospell3[i].id > 0) ? sd->autospell3[i].id : -sd->autospell3[i].id;
if( skillnotok(skill, sd) )
continue;
@@ -1113,6 +1116,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
continue;
sd->state.autocast = 1;
+ sd->autospell3[i].lock = true;
skill_consume_requirement(sd,skill,skilllv,1);
switch( skill_get_casttype(skill) )
{
@@ -1120,6 +1124,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
case CAST_NODAMAGE: skill_castend_nodamage_id(&sd->bl, tbl, skill, skilllv, tick, 0); break;
case CAST_DAMAGE: skill_castend_damage_id(&sd->bl, tbl, skill, skilllv, tick, 0); break;
}
+ sd->autospell3[i].lock = false;
sd->state.autocast = 0;
}
@@ -1137,7 +1142,6 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
}
}
- sd->state.skillonskill = 0;
return 1;
}
@@ -3096,8 +3100,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
{
if( sd->state.arrow_atk ) //Consume arrow on last invocation to this skill.
battle_consume_ammo(sd, skillid, skilllv);
- if( !sd->state.skillonskill )
- skill_onskillusage(sd, bl, skillid, tick);
+ skill_onskillusage(sd, bl, skillid, tick);
skill_consume_requirement(sd,skillid,skilllv,2);
}
@@ -5718,8 +5721,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
{
if( sd->state.arrow_atk ) //Consume arrow on last invocation to this skill.
battle_consume_ammo(sd, skillid, skilllv);
- if( !sd->state.skillonskill )
- skill_onskillusage(sd, bl, skillid, tick);
+ skill_onskillusage(sd, bl, skillid, tick);
skill_consume_requirement(sd,skillid,skilllv,2);
}
@@ -6583,8 +6585,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
{
if( sd->state.arrow_atk && !(flag&1) ) //Consume arrow if a ground skill was not invoked. [Skotlex]
battle_consume_ammo(sd, skillid, skilllv);
- if( !sd->state.skillonskill )
- skill_onskillusage(sd, NULL, skillid, tick);
+ skill_onskillusage(sd, NULL, skillid, tick);
skill_consume_requirement(sd,skillid,skilllv,2);
}