summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-09 16:54:36 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-09 16:54:36 +0000
commit3d6011c46f2f556aa0b9ad41c9e6139ba687e90d (patch)
treed9e48e7cf18157e39b541d3232806c58d488642e
parent52db25907d75f8d9d9eb914e794f8622c5f540b9 (diff)
downloadhercules-3d6011c46f2f556aa0b9ad41c9e6139ba687e90d.tar.gz
hercules-3d6011c46f2f556aa0b9ad41c9e6139ba687e90d.tar.bz2
hercules-3d6011c46f2f556aa0b9ad41c9e6139ba687e90d.tar.xz
hercules-3d6011c46f2f556aa0b9ad41c9e6139ba687e90d.zip
- Moved a bunch of sc_effects that should be cancelled on hit from mob_damage/pc_damage to battle_damage.
- Changed ITEM_NAME_LENGTH to 50. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5533 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/common/mmo.h2
-rw-r--r--src/map/battle.c10
-rw-r--r--src/map/itemdb.c14
-rw-r--r--src/map/mob.c9
-rw-r--r--src/map/pc.c10
6 files changed, 19 insertions, 27 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index fdae9d0f0..86abd3c6f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,7 @@ 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/09
+ * Changed ITEM_NAME_LENGTH to 50. [Skotlex]
* Fixed stun's duration not getting reduced by vit + luk/3 [Skotlex]
* Fixed #itemlist not taking into consideration crafted/forged items and
pet eggs. [Skotlex]
diff --git a/src/common/mmo.h b/src/common/mmo.h
index a58e8de86..ab9fd6dd7 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -99,7 +99,7 @@
//Includes null-terminator as it is the length of the array.
#define NAME_LENGTH 24
//For item names, which tend to have much longer names.
-#define ITEM_NAME_LENGTH 24
+#define ITEM_NAME_LENGTH 50
//For Map Names, which the client considers to be 16 in length
#define MAP_NAME_LENGTH 16
diff --git a/src/map/battle.c b/src/map/battle.c
index b75bf0f16..4fc5fb72f 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -260,6 +260,16 @@ int battle_damage(struct block_list *bl,struct block_list *target,int damage, in
status_change_end(target,SC_SLEEP,-1);
if (sc->data[SC_WINKCHARM].timer != -1)
status_change_end(target,SC_WINKCHARM,-1);
+ if (sc->data[SC_CONFUSION].timer != -1)
+ status_change_end(target, SC_CONFUSION, -1);
+ if (sc->data[SC_TRICKDEAD].timer != -1)
+ status_change_end(target, SC_TRICKDEAD, -1);
+ if (sc->data[SC_HIDING].timer != -1)
+ status_change_end(target, SC_HIDING, -1);
+ if (sc->data[SC_CLOAKING].timer != -1)
+ status_change_end(target, SC_CLOAKING, -1);
+ if (sc->data[SC_CHASEWALK].timer != -1)
+ status_change_end(target, SC_CHASEWALK, -1);
}
if (target->type == BL_MOB) { // MOB
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 0e7241ea8..814a5239e 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -238,8 +238,8 @@ static void create_dummy_data(void) {
dummy_item->nameid=500;
dummy_item->weight=1;
dummy_item->type=3; //Etc item
- strncpy(dummy_item->name,"UNKNOWN_ITEM",ITEM_NAME_LENGTH);
- strncpy(dummy_item->jname,"UNKNOWN_ITEM",ITEM_NAME_LENGTH);
+ strncpy(dummy_item->name,"UNKNOWN_ITEM",ITEM_NAME_LENGTH-1);
+ strncpy(dummy_item->jname,"UNKNOWN_ITEM",ITEM_NAME_LENGTH-1);
dummy_item->view_id = 512; //Use apple sprite.
}
@@ -575,7 +575,7 @@ static int itemdb_read_itemnametable(void)
}
#endif
- memcpy(itemdb_search(nameid)->jname,buf2,ITEM_NAME_LENGTH-1);
+ strncpy(itemdb_search(nameid)->jname,buf2,ITEM_NAME_LENGTH-1);
}
p=strchr(p,10);
@@ -848,8 +848,8 @@ static int itemdb_read_sqldb(void)
// ----------
id = itemdb_load(nameid);
- memcpy(id->name, sql_row[1], ITEM_NAME_LENGTH);
- memcpy(id->jname, sql_row[2], ITEM_NAME_LENGTH);
+ strncpy(id->name, sql_row[1], ITEM_NAME_LENGTH-1);
+ strncpy(id->jname, sql_row[2], ITEM_NAME_LENGTH-1);
id->type = atoi(sql_row[3]);
if (id->type == 11)
@@ -991,8 +991,8 @@ static int itemdb_readdb(void)
//ID,Name,Jname,Type,Price,Sell,Weight,ATK,DEF,Range,Slot,Job,Job Upper,Gender,Loc,wLV,eLV,refineable,View
id=itemdb_load(nameid);
- memcpy(id->name, str[1], ITEM_NAME_LENGTH);
- memcpy(id->jname, str[2], ITEM_NAME_LENGTH);
+ strncpy(id->name, str[1], ITEM_NAME_LENGTH-1);
+ strncpy(id->jname, str[2], ITEM_NAME_LENGTH-1);
id->type=atoi(str[3]);
if (id->type == 11)
{ //Items that are consumed upon target confirmation
diff --git a/src/map/mob.c b/src/map/mob.c
index 5a0b7d422..2b267f201 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2308,15 +2308,6 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
return 0;
}
- if(md->sc.count) {
- if(md->sc.data[SC_CONFUSION].timer != -1)
- status_change_end(&md->bl, SC_CONFUSION, -1);
- if(md->sc.data[SC_HIDING].timer != -1)
- status_change_end(&md->bl, SC_HIDING, -1);
- if(md->sc.data[SC_CLOAKING].timer != -1)
- status_change_end(&md->bl, SC_CLOAKING, -1);
- }
-
if(damage > max_hp>>2)
skill_stop_dancing(&md->bl);
diff --git a/src/map/pc.c b/src/map/pc.c
index b57ae27d2..549f7678c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5253,16 +5253,6 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
status_change_end(&sd->bl, SC_GRAVITATION, -1);
}
}
- if (sd->sc.data[SC_CONFUSION].timer != -1)
- status_change_end(&sd->bl, SC_CONFUSION, -1);
- if (sd->sc.data[SC_TRICKDEAD].timer != -1)
- status_change_end(&sd->bl, SC_TRICKDEAD, -1);
- if (sd->sc.data[SC_HIDING].timer != -1)
- status_change_end(&sd->bl, SC_HIDING, -1);
- if (sd->sc.data[SC_CLOAKING].timer != -1)
- status_change_end(&sd->bl, SC_CLOAKING, -1);
- if (sd->sc.data[SC_CHASEWALK].timer != -1)
- status_change_end(&sd->bl, SC_CHASEWALK, -1);
}
// 演奏/ダンスの中?