Feature #2428 ยป 0079-savegame-Save-unit-s-scouting-tile.patch
| server/savegame/savecompat.c | ||
|---|---|---|
|
secfile_entry_ignore(loading->file, "player%d.c%d.allow_specialists",
|
||
|
plrno, cnro);
|
||
|
}
|
||
|
if (format_class != SAVEGAME_2) {
|
||
|
int nunits = secfile_lookup_int_default(loading->file, 0,
|
||
|
"player%d.nunits",
|
||
|
plrno);
|
||
|
int unro;
|
||
|
for (unro = 0; unro < nunits; unro++) {
|
||
|
secfile_insert_int(loading->file, -1, "player%d.u%d.scout_x",
|
||
|
plrno, unro);
|
||
|
secfile_insert_int(loading->file, -1, "player%d.u%d.scout_y",
|
||
|
plrno, unro);
|
||
|
}
|
||
|
}
|
||
|
} player_slots_iterate_end;
|
||
|
}
|
||
| ... | ... | |
|
int plrno = player_slot_index(pslot);
|
||
|
int ncities;
|
||
|
int cnro;
|
||
|
int nunits;
|
||
|
int unro;
|
||
|
if (secfile_section_lookup(loading->file, "player%d", plrno) == nullptr) {
|
||
|
continue;
|
||
| ... | ... | |
|
secfile_entry_ignore(loading->file, "player%d.c%d.allow_specialists",
|
||
|
plrno, cnro);
|
||
|
}
|
||
|
nunits = secfile_lookup_int_default(loading->file, 0,
|
||
|
"player%d.nunits",
|
||
|
plrno);
|
||
|
for (unro = 0; unro < nunits; unro++) {
|
||
|
if (secfile_entry_lookup(loading->file, "player%d.u%d.scout_x",
|
||
|
plrno, unro) == nullptr) {
|
||
|
secfile_insert_int(loading->file, -1, "player%d.u%d.scout_x",
|
||
|
plrno, unro);
|
||
|
secfile_insert_int(loading->file, -1, "player%d.u%d.scout_y",
|
||
|
plrno, unro);
|
||
|
}
|
||
|
}
|
||
|
} player_slots_iterate_end;
|
||
|
} /* Version < 3.3.91 */
|
||
| server/savegame/savegame3.c | ||
|---|---|---|
|
secfile_insert_int(saving->file, 0, "%s.goto_y", buf);
|
||
|
}
|
||
|
if (punit->server.scout_vision != nullptr) {
|
||
|
index_to_native_pos(&nat_x, &nat_y,
|
||
|
tile_index(punit->server.scout_vision->tile));
|
||
|
secfile_insert_int(saving->file, nat_x, "%s.scout_x", buf);
|
||
|
secfile_insert_int(saving->file, nat_y, "%s.scout_y", buf);
|
||
|
} else {
|
||
|
/* Set this values to allow saving it as table. */
|
||
|
secfile_insert_int(saving->file, -1, "%s.scout_x", buf);
|
||
|
secfile_insert_int(saving->file, -1, "%s.scout_y", buf);
|
||
|
}
|
||
|
secfile_insert_int(saving->file, punit->ssa_controller,
|
||
|
"%s.server_side_agent", buf);
|
||