Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clif->pLoadEndAck being called in pc->scdata_received before receiving client's loadendack #3277

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading