summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-29 14:10:22 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-29 14:10:22 +0000
commit5723fdae682d71948b2b10161e336d36ea03bdfa (patch)
treea49f68754a7b3a50cd81751329f5100f2d41e550
parent0a68e706bac90f56073f3ad2a30c4bada260225c (diff)
downloadhercules-5723fdae682d71948b2b10161e336d36ea03bdfa.tar.gz
hercules-5723fdae682d71948b2b10161e336d36ea03bdfa.tar.bz2
hercules-5723fdae682d71948b2b10161e336d36ea03bdfa.tar.xz
hercules-5723fdae682d71948b2b10161e336d36ea03bdfa.zip
- Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than status.hp/sp, fixes scripts reading the wrong Hp/Sp values
- Added some missing SC_* entries on the initial listing (potion related and speed up ones) - Fixed function declaration of map_getcellp() git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6817 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/path.c4
-rw-r--r--src/map/pc.c16
-rw-r--r--src/map/status.c23
6 files changed, 36 insertions, 18 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 9bf5ac4c7..b0c1234d5 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/29
+ * Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than
+ status.hp/sp, fixes scripts reading the wrong Hp/Sp values [Skotlex]
+ * Added some missing SC_* entries on the initial listing (potion related
+ and speed up ones) [Skotlex]
+ * Fixed function declaration of map_getcellp() [Skotlex]
* [Fixed]:
- status.c:920: warning: 'mbl' might be used uninitialized in this function
- skill.c:6648: warning: 'matk_min' might be used uninitialized in this function
diff --git a/src/map/map.c b/src/map/map.c
index 1952acb45..3833acb34 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2162,7 +2162,7 @@ int map_getcell(int m,int x,int y,cell_t cellchk)
return (m < 0 || m >= MAX_MAP_PER_SERVER) ? 0 : map_getcellp(&map[m],x,y,cellchk);
}
-int map_getcellp(struct map_data* m,int x,int y,int cellchk)
+int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
{
int type, type2;
#ifdef CELL_NOSTACK
diff --git a/src/map/map.h b/src/map/map.h
index adbf76620..23d920011 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1372,11 +1372,11 @@ int map_setwaterheight(int m, char *mapname, int height);
int map_waterheight(char *mapname);
// path.c
-int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,int flag2);
+int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2);
#define path_search(wpd,m,x0,y0,x1,y1,flag) path_search_real(wpd,m,x0,y0,x1,y1,flag,CELL_CHKNOPASS)
#define path_search2(wpd,m,x0,y0,x1,y1,flag) path_search_real(wpd,m,x0,y0,x1,y1,flag,CELL_CHKWALL)
-int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,int flag);
+int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,cell_t flag);
#define path_search_long(spd,m,x0,y0,x1,y1) path_search_long_real(spd,m,x0,y0,x1,y1,CELL_CHKWALL)
int path_blownpos(int m,int x0,int y0,int dx,int dy,int count);
diff --git a/src/map/path.c b/src/map/path.c
index 7e6dd9464..1255f655d 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -237,7 +237,7 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count)
*------------------------------------------
*/
#define swap(x,y) { int t; t = x; x = y; y = t; }
-int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,int flag)
+int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1,cell_t flag)
{
int dx, dy;
int wx = 0, wy = 0;
@@ -306,7 +306,7 @@ int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,
* pathT (x0,y0)->(x1,y1)
*------------------------------------------
*/
-int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,int flag2)
+int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2)
{
int heap[MAX_HEAP+1];
struct tmp_path tp[MAX_WALKPATH*MAX_WALKPATH];
diff --git a/src/map/pc.c b/src/map/pc.c
index 3a573f97f..b0e7e8506 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4811,16 +4811,16 @@ int pc_readparam(struct map_session_data *sd,int type)
val= pc_nextjobexp(sd);
break;
case SP_HP:
- val= sd->status.hp;
+ val= sd->battle_status.hp;
break;
case SP_MAXHP:
- val= sd->status.max_hp;
+ val= sd->battle_status.max_hp;
break;
case SP_SP:
- val= sd->status.sp;
+ val= sd->battle_status.sp;
break;
case SP_MAXSP:
- val= sd->status.max_sp;
+ val= sd->battle_status.max_sp;
break;
case SP_STR:
val= sd->status.str;
@@ -4952,16 +4952,16 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
sd->max_weight = val;
break;
case SP_HP:
- sd->status.hp = val;
+ sd->battle_status.hp = val;
break;
case SP_MAXHP:
- sd->status.max_hp = val;
+ sd->battle_status.max_hp = val;
break;
case SP_SP:
- sd->status.sp = val;
+ sd->battle_status.sp = val;
break;
case SP_MAXSP:
- sd->status.max_sp = val;
+ sd->battle_status.max_sp = val;
break;
case SP_STR:
sd->status.str = val;
diff --git a/src/map/status.c b/src/map/status.c
index 4baa3d8d3..66f1e3901 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -369,17 +369,25 @@ void initChangeTables(void) {
SkillStatusChangeTable[SL_SOULLINKER] = MAPID_SOUL_LINKER,
//Status that don't have a skill associated.
- StatusIconChangeTable[SC_WEIGHT50 ] = SI_WEIGHT50;
- StatusIconChangeTable[SC_WEIGHT90] = SI_WEIGHT90;
+ StatusIconChangeTable[SC_WEIGHT50] = SI_WEIGHT50;
+ StatusIconChangeTable[SC_WEIGHT90] = SI_WEIGHT90;
StatusIconChangeTable[SC_ASPDPOTION0] = SI_ASPDPOTION;
StatusIconChangeTable[SC_ASPDPOTION1] = SI_ASPDPOTION;
StatusIconChangeTable[SC_ASPDPOTION2] = SI_ASPDPOTION;
StatusIconChangeTable[SC_ASPDPOTION3] = SI_ASPDPOTION;
- StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION;
- StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION;
- StatusIconChangeTable[SC_MIRACLE] = SI_SPIRIT;
+ StatusIconChangeTable[SC_SPEEDUP0] = SI_SPEEDPOTION;
+ StatusIconChangeTable[SC_SPEEDUP1] = SI_SPEEDPOTION;
+ StatusIconChangeTable[SC_MIRACLE] = SI_SPIRIT;
//Other SC which are not necessarily associated to skills.
+ StatusChangeFlagTable[SC_ASPDPOTION0] = SCB_ASPD;
+ StatusChangeFlagTable[SC_ASPDPOTION1] = SCB_ASPD;
+ StatusChangeFlagTable[SC_ASPDPOTION2] = SCB_ASPD;
+ StatusChangeFlagTable[SC_ASPDPOTION3] = SCB_ASPD;
+ StatusChangeFlagTable[SC_SPEEDUP0] = SCB_SPEED;
+ StatusChangeFlagTable[SC_SPEEDUP1] = SCB_SPEED;
+ StatusChangeFlagTable[SC_ATKPOTION] = SCB_BATK;
+ StatusChangeFlagTable[SC_MATKPOTION] = SCB_MATK;
StatusChangeFlagTable[SC_INCALLSTATUS] |= SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK;
StatusChangeFlagTable[SC_INCSTR] |= SCB_STR;
StatusChangeFlagTable[SC_INCAGI] |= SCB_AGI;
@@ -3830,6 +3838,11 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
//Check for inmunities / sc fails
switch (type) {
+ case SC_POISON:
+ case SC_DPOISON:
+ if (undead_flag && !(flag&1))
+ return 0; //Undead inmune to poison. Thanks to orn [Skotlex]
+ break;
case SC_FREEZE:
case SC_STONE:
//Undead are inmune to Freeze/Stone