Residents now consume items other than food for clothing repairs etc.
This commit is contained in:
@@ -885,9 +885,9 @@ bool save_game_state() {
|
||||
saveData.set("player_item_break_pending_type", playerItemBreakPendingType);
|
||||
saveData.set("quest_roll_done_today", quest_roll_done_today);
|
||||
saveData.set("wight_spawn_chance", wight_spawn_chance);
|
||||
saveData.set("wight_spawned_this_night", wight_spawned_this_night);
|
||||
saveData.set("wight_spawned_this_night", wight_spawned_this_night_count);
|
||||
saveData.set("vampyr_spawn_chance", vampyr_spawn_chance);
|
||||
saveData.set("vampyr_spawned_this_night", vampyr_spawned_this_night);
|
||||
saveData.set("vampyr_spawned_this_night", vampyr_spawned_this_night_count);
|
||||
string[] questData;
|
||||
for (uint i = 0; i < quest_queue.length(); i++) {
|
||||
questData.insert_last("" + quest_queue[i]);
|
||||
@@ -1337,11 +1337,21 @@ bool load_game_state_from_file(const string&in filename) {
|
||||
reset_player_item_break_audio_state();
|
||||
quest_roll_done_today = get_bool(saveData, "quest_roll_done_today", false);
|
||||
wight_spawn_chance = int(get_number(saveData, "wight_spawn_chance", WIGHT_SPAWN_CHANCE_START));
|
||||
wight_spawned_this_night = get_bool(saveData, "wight_spawned_this_night", false);
|
||||
if (has_number_key(saveData, "wight_spawned_this_night")) {
|
||||
wight_spawned_this_night_count = int(get_number(saveData, "wight_spawned_this_night", 0));
|
||||
} else {
|
||||
wight_spawned_this_night_count = get_bool(saveData, "wight_spawned_this_night", false) ? 1 : 0;
|
||||
}
|
||||
if (wight_spawned_this_night_count < 0) wight_spawned_this_night_count = 0;
|
||||
if (wight_spawn_chance < WIGHT_SPAWN_CHANCE_START) wight_spawn_chance = WIGHT_SPAWN_CHANCE_START;
|
||||
if (wight_spawn_chance > 100) wight_spawn_chance = 100;
|
||||
vampyr_spawn_chance = int(get_number(saveData, "vampyr_spawn_chance", VAMPYR_SPAWN_CHANCE_START));
|
||||
vampyr_spawned_this_night = get_bool(saveData, "vampyr_spawned_this_night", false);
|
||||
if (has_number_key(saveData, "vampyr_spawned_this_night")) {
|
||||
vampyr_spawned_this_night_count = int(get_number(saveData, "vampyr_spawned_this_night", 0));
|
||||
} else {
|
||||
vampyr_spawned_this_night_count = get_bool(saveData, "vampyr_spawned_this_night", false) ? 1 : 0;
|
||||
}
|
||||
if (vampyr_spawned_this_night_count < 0) vampyr_spawned_this_night_count = 0;
|
||||
if (vampyr_spawn_chance < VAMPYR_SPAWN_CHANCE_START) vampyr_spawn_chance = VAMPYR_SPAWN_CHANCE_START;
|
||||
if (vampyr_spawn_chance > 100) vampyr_spawn_chance = 100;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user