summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-23 18:41:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-23 18:41:56 +0000
commiteb0a137041d3a5ee6385762b8374e98b3867d5a0 (patch)
treef11f4036af32507c0e6bbc92b55d17d07f4e3692 /src/map/pc.c
parent9157078e09096898afee0c9be17737df72bebaee (diff)
downloadhercules-eb0a137041d3a5ee6385762b8374e98b3867d5a0.tar.gz
hercules-eb0a137041d3a5ee6385762b8374e98b3867d5a0.tar.bz2
hercules-eb0a137041d3a5ee6385762b8374e98b3867d5a0.tar.xz
hercules-eb0a137041d3a5ee6385762b8374e98b3867d5a0.zip
- Minor cleanups
- Adjusted menu-based skills so you can't reuse the same skill until you've dealt with the menu. - Adjust autospells so that removing an autospell works when the script of the card that removes the autospell is triggered before the script that adds the spell. - The "requested name of gm-hidden char" warning will not be displayed when the object in question is an NPC (since you can use Intravision to do this). - Corrected the header format for invisible npcs. - Venom Knife no longer takes into accounts cards or EDP. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9905 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 88b7fde40..1dd9fa7f3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1193,7 +1193,7 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
if (i<0) return 0; //Nothing to substract from.
j = i;
- for(; i>=0 && rate > 0; i--)
+ for(; i>=0 && rate>0; i--)
{
if (spell[i].id != id || spell[i].lv != lv) continue;
if (rate >= spell[i].rate) {
@@ -1207,6 +1207,13 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
rate = 0;
}
}
+ if (rate > 0 && ++j < max)
+ { //Tag this as "pending" autospell to remove.
+ spell[j].id = id;
+ spell[j].lv = lv;
+ spell[j].rate = -rate;
+ spell[j].card_id = 0;
+ }
return rate;
}
@@ -1216,12 +1223,13 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor
pc_bonus_autospell_del(spell, max, id, lv, -rate, card_id);
for (i = 0; i < max && spell[i].id; i++) {
- if (spell[i].card_id == card_id &&
+ if ((spell[i].card_id == card_id || !spell[i].card_id) &&
spell[i].id == id && spell[i].lv == lv)
{
- if (!battle_config.autospell_stacking)
+ if (!battle_config.autospell_stacking && spell[i].rate > 0)
return 0;
rate += spell[i].rate;
+ if (rate < 0) card_id = 0; //Reduced from debted autospell.
break;
}
}