summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-14 23:52:01 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-14 23:52:01 +0000
commitcffd40f5ba4897e1099ba843dac80363f4a20aca (patch)
tree51d8acfbdca1c21a098bb03f76b62f612154dafe /src/map
parentfd3e05f2efdfb6844cb213658213d782cbbd9af2 (diff)
downloadhercules-cffd40f5ba4897e1099ba843dac80363f4a20aca.tar.gz
hercules-cffd40f5ba4897e1099ba843dac80363f4a20aca.tar.bz2
hercules-cffd40f5ba4897e1099ba843dac80363f4a20aca.tar.xz
hercules-cffd40f5ba4897e1099ba843dac80363f4a20aca.zip
- Fixed skill_notok blocking guild skills
- Fixed Napalm vulcan's time2 entry in the skill_cast_db - Removed a pair of debug switches that shouldn't be needed anymore. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5604 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/skill.c33
2 files changed, 15 insertions, 23 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index acdf2e62c..fe2783272 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5090,7 +5090,10 @@ int pc_resetstate(struct map_session_data* sd)
add += sumsp(sd->status.int_);
add += sumsp(sd->status.dex);
add += sumsp(sd->status.luk);
- sd->status.status_point+=add;
+ if (add > SHRT_MAX - sd->status.status_point)
+ sd->status.status_point = SHRT_MAX;
+ else
+ sd->status.status_point+=add;
}
sd->status.str=1;
diff --git a/src/map/skill.c b/src/map/skill.c
index 8e1910b61..f1fff626d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -766,23 +766,24 @@ int can_copy(struct map_session_data *sd, int skillid)
// [MouseJstr] - skill ok to cast? and when?
int skillnotok(int skillid, struct map_session_data *sd)
{
+ int i = skillid;
nullpo_retr (1, sd);
//if (sd == 0)
//return 0;
//return 1;
// I think it was meant to be "no skills allowed when not a valid sd"
- if (!(skillid >= GD_SKILLRANGEMIN && skillid <= GD_SKILLRANGEMAX))
- if ((skillid > MAX_SKILL) || (skillid < 0))
- return 1;
+ if (skillid >= GD_SKILLRANGEMIN && skillid <= GD_SKILLRANGEMAX)
+ return 1;
- {
- int i = skillid;
- if (i >= GD_SKILLBASE)
- i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
- if (sd->blockskill[i] > 0)
- return 1;
- }
+ if (i >= GD_SKILLBASE)
+ i = GD_SKILLRANGEMIN + i - GD_SKILLBASE;
+
+ if (sd->blockskill[i] > 0)
+ return 1;
+
+ if (i > MAX_SKILL || i < 0)
+ return 1;
if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond)
return 0; // gm's can do anything damn thing they want
@@ -2494,12 +2495,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
struct map_session_data *sd = NULL, *tsd = NULL;
struct status_change *sc;
- if(skillid < 0)
- { // remove the debug print when this case is finished
- ShowDebug("skill_castend_damage_id: skillid=%i\ncall: %p %p %i %i %i %i",skillid,
- src, bl,skillid,skilllv,tick,flag);
- return 0;
- }
if (skillid > 0 && skilllv <= 0) return 0;
nullpo_retr(1, src);
@@ -3212,12 +3207,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
struct mob_data *dstmd = NULL;
int i,type=-1;
- if(skillid < 0 || (skillid > MAX_SKILL || (skillid >= GD_SKILLBASE && skillid > GD_SKILLBASE + MAX_GUILDSKILL)))
- { // remove the debug print when this case is finished
- ShowDebug("skill_castend_nodamage_id: skillid=%i call: %p %p %i %i %i %i\n",skillid,
- src, bl,skillid,skilllv,tick,flag);
- return 0;
- }
if(skillid > 0 && skilllv <= 0) return 0; // celest
nullpo_retr(1, src);