Project

General

Profile

Feature #643 ยป 0081-Savegame-Save-last_turn_change_time-as-a-float.patch

Marko Lindqvist, 05/18/2024 02:36 AM

View differences:

server/savegame/savecompat.c
game.info.turn = secfile_lookup_int_default(loading->file, 0, "game.turn");
secfile_insert_int(loading->file, game.info.turn, "game.world_peace_start");
/* Last turn change time as a float, not integer multiplied by 100 */
{
float tct = secfile_lookup_int_default(loading->file, 0,
"game.last_turn_change_time") / 100.0;
secfile_replace_float(loading->file, tct, "game.last_turn_change_time");
}
{
int ssa_count;
......
secfile_replace_int(loading->file, game.server.world_peace_start,
"game.world_peace_start");
/* Last turn change time as a float, not integer multiplied by 100 */
{
float tct = secfile_lookup_int_default(loading->file, 0,
"game.last_turn_change_time") / 100.0;
secfile_replace_float(loading->file, tct, "game.last_turn_change_time");
}
/* Add actions for unit activities */
loading->activities.size
= secfile_lookup_int_default(loading->file, 0,
server/savegame/savegame2.c
= !secfile_lookup_bool_default(loading->file, TRUE, "game.save_players");
game.server.turn_change_time
= secfile_lookup_int_default(loading->file, 0, "game.last_turn_change_time") / 100.0;
= secfile_lookup_float_default(loading->file, 0, "game.last_turn_change_time");
}
/* =======================================================================
server/savegame/savegame3.c
= !secfile_lookup_bool_default(loading->file, TRUE, "game.save_players");
game.server.turn_change_time
= secfile_lookup_int_default(loading->file, 0, "game.last_turn_change_time") / 100.0;
= secfile_lookup_float_default(loading->file, 0, "game.last_turn_change_time");
}
/************************************************************************//**
......
saving->save_players = TRUE;
}
#ifndef SAVE_DUMMY_TURN_CHANGE_TIME
secfile_insert_int(saving->file, game.server.turn_change_time * 100,
"game.last_turn_change_time");
secfile_insert_float(saving->file, game.server.turn_change_time,
"game.last_turn_change_time");
#else /* SAVE_DUMMY_TURN_CHANGE_TIME */
secfile_insert_int(saving->file, game.info.turn * 10,
"game.last_turn_change_time");
secfile_insert_float(saving->file, game.info.turn * 0.1,
"game.last_turn_change_time");
#endif /* SAVE_DUMMY_TURN_CHANGE_TIME */
}
secfile_insert_bool(saving->file, saving->save_players,
utility/registry_ini.h
#define secfile_insert_float(secfile, value, path, ...) \
secfile_insert_float_full(secfile, value, nullptr, FALSE, \
path, ## __VA_ARGS__)
#define secfile_replace_float(secfile, value, path, ...) \
secfile_insert_float_full(secfile, value, nullptr, TRUE, \
path, ## __VA_ARGS__)
struct section *secfile_insert_include(struct section_file *secfile,
const char *filename);
    (1-1/1)