From cffd40f5ba4897e1099ba843dac80363f4a20aca Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 14 Mar 2006 23:52:01 +0000 Subject: - 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 --- Changelog-Trunk.txt | 2 ++ db/skill_cast_db.txt | 2 +- src/map/pc.c | 5 ++++- src/map/skill.c | 33 +++++++++++---------------------- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9dcb793ed..c203654eb 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS 2006/03/14 + * Fixed skill_notok blocking guild skills [Skotlex] + * Fixed Napalm vulcan's time2 entry in the skill_cast_db [Skotlex] * Fixed the average_lv column size specification for levels above 255. Thanks to Joshuaali (upgrade_svn5607.sql) [Skotlex] * Updated @rura/@warp. Now you can use both "@warp mapname x y" and diff --git a/db/skill_cast_db.txt b/db/skill_cast_db.txt index f55b49613..81f8197a1 100644 --- a/db/skill_cast_db.txt +++ b/db/skill_cast_db.txt @@ -631,7 +631,7 @@ //-- LK_JOINTBEAT 399,0,800:800:800:800:800:1000:1000:1000:1000:1000,0,0,30000 //-- HW_NAPALMVULCAN -400,1700,1000,0,0,0,45000 +400,1700,1000,0,0,45000 //-- CH_SOULCOLLECT 401,2000,0,0,600000,0 //-- PF_MINDBREAKER 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); -- cgit v1.2.3-70-g09d2