Skip to content

Commit

Permalink
Fixed issue: 7694
Browse files Browse the repository at this point in the history
  • Loading branch information
panikon committed Apr 12, 2014
1 parent 6a27692 commit 6f6a6b3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
23 changes: 15 additions & 8 deletions src/map/clif.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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

This comment has been minimized.

Copy link
@MishimaHaruna

MishimaHaruna Apr 12, 2014

Member

Did you mean !(tmp&INF_SELF_SKILL) here? It's not the same as !tmp&INF_SELF_SKILL (the latter being (!tmp)&INF_SELF_SKILL) which doesn't make much sense)

This comment has been minimized.

Copy link
@shennetsind

shennetsind Apr 17, 2014

Member

bapti-bipti-bump.

This comment has been minimized.

Copy link
@panikon

panikon Apr 17, 2014

Author Member

@shennetsind Haru already corrected this in f4a566f

This comment has been minimized.

Copy link
@shennetsind

shennetsind Apr 17, 2014

Member

oh i see. thank you!

)
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;

Expand Down
1 change: 0 additions & 1 deletion src/map/guild.c
Expand Up @@ -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;
Expand Down
13 changes: 9 additions & 4 deletions src/map/npc.c
Expand Up @@ -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;

Expand Down

0 comments on commit 6f6a6b3

Please sign in to comment.