Skip to content

Commit

Permalink
Fix clif->pLoadEndAck being called in pc->scdata_received before rece…
Browse files Browse the repository at this point in the history
…iving client's loadendack
  • Loading branch information
skyleo committed Jan 26, 2024
1 parent b5a59b1 commit e01bbbe
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 e01bbbe

Please sign in to comment.