summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-01-31 12:57:07 -0700
committerFate <fate-tmw@googlemail.com>2009-01-31 12:57:07 -0700
commitd2bc97170e91765de7ab67b017085370a26e3f93 (patch)
tree4808258d8e6139f68e254a042318f3815a5f3047 /src/map/pc.c
parentd62b01b62ac59e84c13782af2067f5669a97221e (diff)
downloadtmwa-d2bc97170e91765de7ab67b017085370a26e3f93.tar.gz
tmwa-d2bc97170e91765de7ab67b017085370a26e3f93.tar.bz2
tmwa-d2bc97170e91765de7ab67b017085370a26e3f93.tar.xz
tmwa-d2bc97170e91765de7ab67b017085370a26e3f93.zip
When running out of spell charges, make sure to use spell attack delay for last attack, too
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 0eac9eb..e6efe45 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4149,7 +4149,7 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
struct status_change *sc_data;
short *opt;
int dist,skill,range;
-
+ int attack_spell_delay;
sd=map_id2sd(id);
if(sd == NULL)
@@ -4203,10 +4203,11 @@ int pc_attack_timer(int tid,unsigned int tick,int id,int data)
if (sd->attackabletime > tick)
return 0; // cannot attack yet
+ attack_spell_delay = sd->attack_spell_delay;
if (sd->attack_spell_override // [Fate] If we have an active attack spell, use that
&& spell_attack(id, sd->attacktarget)) {
// Return if the spell succeeded. If the spell had disspiated, spell_attack() may fail.
- sd->attackabletime = tick + sd->attack_spell_delay;
+ sd->attackabletime = tick + attack_spell_delay;
} else {
dist = distance(sd->bl.x,sd->bl.y,bl->x,bl->y);