Skip to content

Commit

Permalink
Merge pull request HerculesWS#3277 from skyleo/fix-always-loadendack-…
Browse files Browse the repository at this point in the history
…in-scloaded

Fix clif->pLoadEndAck being called in pc->scdata_received before receiving client's loadendack
  • Loading branch information
MishimaHaruna authored Feb 5, 2024
2 parents 974273b + e01bbbe commit eb142b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -11163,6 +11163,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd)
}

if (sd->state.scloaded == 0) { // SC data was not received yet. pc->scdata_received will reinvoke
sd->state.loadendack_before_scloaded = 1;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/map/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12016,10 +12016,10 @@ static void pc_scdata_received(struct map_session_data *sd)
clif->pLoadEndAck(0,sd);
pc->autotrade_populate(sd);
pc->autotrade_start(sd);
} else {
} else if (sd->state.loadendack_before_scloaded != 0) {
clif->pLoadEndAck(sd->fd, sd);
sd->state.loadendack_before_scloaded = 0;
}

}
static int pc_expiration_timer(int tid, int64 tick, int id, intptr_t data)
{
Expand Down
1 change: 1 addition & 0 deletions src/map/pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ struct map_session_data {
struct {
unsigned int active : 1; //Marks active player (not active is logging in/out, or changing map servers)
unsigned int scloaded : 1; // Marks sc related data has been loaded for player
unsigned int loadendack_before_scloaded : 1; // Marks that the LoadEndAck packet was received before scloaded
unsigned int menu_or_input : 1;// if a script is waiting for feedback from the player
unsigned int dead_sit : 2;
unsigned int lr_flag : 3;//1: left h. weapon; 2: arrow; 3: shield
Expand Down

0 comments on commit eb142b5

Please sign in to comment.