Project

General

Profile

Bug #1741 » 0006-savegame-Sanity-check-ACTIVITY_GOTO-against-valid-go.patch

Marko Lindqvist, 11/16/2025 11:47 PM

View differences:

server/savegame/savegame2.c
} else {
punit->goto_tile = NULL;
if (punit->activity == ACTIVITY_GOTO) {
/* goto_tile should never be NULL with ACTIVITY_GOTO */
log_sg("Unit %d on goto without goto_tile. Aborting goto.",
punit->id);
punit->activity = ACTIVITY_IDLE;
}
/* These variables are not used but needed for saving the unit table.
* Load them to prevent unused variables errors. */
(void) secfile_entry_lookup(loading->file, "%s.goto_x", unitstr);
server/savegame/savegame3.c
} else {
punit->goto_tile = NULL;
if (punit->activity == ACTIVITY_GOTO) {
/* goto_tile should never be NULL with ACTIVITY_GOTO */
log_sg("Unit %d on goto without goto_tile. Aborting goto.",
punit->id);
punit->activity = ACTIVITY_IDLE;
}
/* These variables are not used but needed for saving the unit table.
* Load them to prevent unused variables errors. */
(void) secfile_entry_lookup(loading->file, "%s.goto_x", unitstr);
(2-2/3)