summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c23
-rw-r--r--src/map/guild.c1
-rw-r--r--src/map/npc.c13
3 files changed, 24 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 6ca117284..15acfd117 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9237,6 +9237,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
#if PACKETVER >= 20090218
int i;
#endif
+ bool first_time = false;
if(sd->bl.prev != NULL)
return;
@@ -9397,6 +9398,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
if(sd->state.connect_new) {
int lv;
+ first_time = true;
sd->state.connect_new = 0;
clif->skillinfoblock(sd);
clif->hotkeys(sd);
@@ -9537,6 +9539,10 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
clif->weather_check(sd);
+ // This should be displayed last
+ if( sd->guild && first_time )
+ clif->guild_notice(sd, sd->guild);
+
// For automatic triggering of NPCs after map loading (so you don't need to walk 1 step first)
if (map->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNPC))
npc->touch_areanpc(sd,sd->bl.m,sd->bl.x,sd->bl.y);
@@ -11330,14 +11336,15 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if( pc_cant_act(sd)
&& skill_id != RK_REFRESH
- && !(skill_id == SR_GENTLETOUCH_CURE && (sd->sc.opt1 == OPT1_STONE || sd->sc.opt1 == OPT1_FREEZE || sd->sc.opt1 == OPT1_STUN))
- ) {
- // SELF skills can be used with the storage open, issue: 8027
- if( sd->state.storage_flag && tmp&INF_SELF_SKILL )
- storage->close(sd);
- else
- return;
- }
+ && !(skill_id == SR_GENTLETOUCH_CURE && (sd->sc.opt1 == OPT1_STONE || sd->sc.opt1 == OPT1_FREEZE || sd->sc.opt1 == OPT1_STUN))
+ && ( sd->state.storage_flag && !tmp&INF_SELF_SKILL ) // SELF skills can be used with the storage open, issue: 8027
+ )
+ return;
+
+ // Some self skills need to close the storage to work properly
+ if( skill_id == AL_TELEPORT && sd->state.storage_flag )
+ storage->close(sd);
+
if( pc_issit(sd) )
return;
diff --git a/src/map/guild.c b/src/map/guild.c
index 15d13da0b..99c74c217 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -954,7 +954,6 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
if(sd->state.connect_new)
{ //Note that this works because it is invoked in parse_LoadEndAck before connect_new is cleared.
clif->guild_belonginfo(sd,g);
- clif->guild_notice(sd,g);
sd->guild_emblem_id = g->emblem_id;
}
return 0;
diff --git a/src/map/npc.c b/src/map/npc.c
index 5f9422e9f..f872a6170 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1152,14 +1152,19 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
// another it's expected that the OnTouch event be put first in stack, because
// unit_walktoxy_timer is executed before any other function in this case.
// So it's best practice to put an 'end;' before OnTouch events in npcs that
- // have view ids of mobs to avoid this kind of error [Panikon]
+ // have view ids of mobs to avoid this "issue" [Panikon]
if (sd->npc_id != 0) {
- ShowError("npc_click: npc_id != 0\n");
+ // The player clicked a npc after entering an OnTouch area
+ if( sd->areanpc_id == sd->npc_id );
+ else
+ ShowError("npc_click: npc_id != 0\n");
+
return 1;
}
- if(!nd) return 1;
-
+ if( !nd )
+ return 1;
+
if ((nd = npc->checknear(sd,&nd->bl)) == NULL)
return 1;