summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-19 15:24:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-19 15:24:40 +0000
commit2195ff6430fb403f134ad42d995af5729e945c63 (patch)
tree67e6c4d948d63258e435b4dd8947ce036724ea12
parent5024f635214bc967fe5f7bb1cdd1eaac2ef4fe96 (diff)
downloadhercules-2195ff6430fb403f134ad42d995af5729e945c63.tar.gz
hercules-2195ff6430fb403f134ad42d995af5729e945c63.tar.bz2
hercules-2195ff6430fb403f134ad42d995af5729e945c63.tar.xz
hercules-2195ff6430fb403f134ad42d995af5729e945c63.zip
- When enabling/disabling hiding/unhiding an npc, if the npc is a warp, it will use clearchar and spawn packets instead of changeoption. Thanks to Toms for the fix.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7746 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/map/npc.c21
2 files changed, 16 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 6b0094744..f79b75329 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ 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/07/19
+ * When enabling/disabling hiding/unhiding an npc, if the npc is a warp, it
+ will use clearchar and spawn packets instead of changeoption. Thanks to
+ Toms for the fix. [Skotlex]
* Corrected Trim chars to block 'enter', as explained by the Ultra mage.
[Skotlex]
* When the client passes account version 0, the login server will set it to
diff --git a/src/map/npc.c b/src/map/npc.c
index 5a76ef11b..6de42ce27 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -122,19 +122,24 @@ int npc_enable(const char *name,int flag)
if (nd==NULL)
return 0;
- if (flag&1) { // —LŒø‰»
+ if (flag&1)
nd->sc.option&=~OPTION_INVISIBLE;
- clif_changeoption(&nd->bl);
- }else if (flag&2){
+ else if (flag&2)
nd->sc.option&=~OPTION_HIDE;
- clif_changeoption(&nd->bl);
- }else if (flag&4){
+ else if (flag&4)
nd->sc.option|= OPTION_HIDE;
- clif_changeoption(&nd->bl);
- }else{ //Can't change the view_data to invisible class because the view_data for all npcs is shared! [Skotlex]
+ else //Can't change the view_data to invisible class because the view_data for all npcs is shared! [Skotlex]
nd->sc.option|= OPTION_INVISIBLE;
+
+ if (nd->class_ == WARP_CLASS)
+ { //Client won't display option changes for warp portals [Toms]
+ if (nd->sc.option&(OPTION_HIDE|OPTION_INVISIBLE))
+ clif_clearchar(&nd->bl, 0);
+ else
+ clif_spawn(&nd->bl);
+ } else
clif_changeoption(&nd->bl);
- }
+
if(flag&3 && (nd->u.scr.xs > 0 || nd->u.scr.ys >0))
map_foreachinarea( npc_enable_sub,nd->bl.m,nd->bl.x-nd->u.scr.xs,nd->bl.y-nd->u.scr.ys,nd->bl.x+nd->u.scr.xs,nd->bl.y+nd->u.scr.ys,BL_PC,nd);