summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-07 01:27:29 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-07 01:27:29 +0000
commitc15f0c1f8c2b2552d3e697446a5b1e7b57ac642c (patch)
treed5f441e63e88897a9ca02d138d139edff92ac17a
parentbb6e436ff569984e063866836bf4798ec02119b9 (diff)
downloadhercules-c15f0c1f8c2b2552d3e697446a5b1e7b57ac642c.tar.gz
hercules-c15f0c1f8c2b2552d3e697446a5b1e7b57ac642c.tar.bz2
hercules-c15f0c1f8c2b2552d3e697446a5b1e7b57ac642c.tar.xz
hercules-c15f0c1f8c2b2552d3e697446a5b1e7b57ac642c.zip
* Optimized clif.c clif_scriptmenu/input/inputstr to check for sd->state.using_fake_npc before sending one (as it's not required to send twice).
* Reinitialize sd->state.using_fake_npc in clif_parse_LoadEndAck (for scripts that warps players and still continues execution to work). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6509 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/map/clif.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c83abb93c..1b8c02336 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ 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/05
+ * Optimized clif.c clif_scriptmenu/input/inputstr to check for sd->state.using_fake_npc
+ before sending one (as it's not required to send twice).
+ * Reinitialize sd->state.using_fake_npc in clif_parse_LoadEndAck (for scripts that warps
+ players and still continues execution to work). [Lance]
* Updated item_db.sql to current. [Skotlex]
* Fixed a bug in @commands, most likely the reason some people were still
getting crashes. [Skotlex]
diff --git a/src/map/clif.c b/src/map/clif.c
index f95c9aec0..0d0f0d017 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1821,9 +1821,9 @@ int clif_scriptmenu(struct map_session_data *sd, int npcid, char *mes) {
nullpo_retr(0, sd);
- if (bl->type == BL_PC || bl->m!=sd->bl.m ||
+ if (!sd->state.using_fake_npc && (bl->type == BL_PC || bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
- bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)
+ bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))
clif_sendfakenpc(sd, npcid);
fd=sd->fd;
@@ -1846,9 +1846,9 @@ int clif_scriptinput(struct map_session_data *sd, int npcid) {
nullpo_retr(0, sd);
- if (bl->type == BL_PC || bl->m!=sd->bl.m ||
+ if (!sd->state.using_fake_npc && (bl->type == BL_PC || bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
- bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)
+ bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))
clif_sendfakenpc(sd, npcid);
fd=sd->fd;
@@ -1870,9 +1870,9 @@ int clif_scriptinputstr(struct map_session_data *sd, int npcid) {
nullpo_retr(0, sd);
- if (bl->type == BL_PC || bl->m!=sd->bl.m ||
+ if (!sd->state.using_fake_npc && (bl->type == BL_PC || bl->m!=sd->bl.m ||
bl->x<sd->bl.x-AREA_SIZE-1 || bl->x>sd->bl.x+AREA_SIZE+1 ||
- bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1)
+ bl->y<sd->bl.y-AREA_SIZE-1 || bl->y>sd->bl.y+AREA_SIZE+1))
clif_sendfakenpc(sd, npcid);
fd=sd->fd;
@@ -8133,6 +8133,8 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->status.party_id)
clif_party_hp(sd);
+ sd->state.using_fake_npc = 0;
+
// pvp
//if(sd->pvp_timer!=-1 && !battle_config.pk_mode) /PVP Client crash fix* Removed timer deletion
// delete_timer(sd->pvp_timer,pc_calc_pvprank_timer);