Invasions should happen even if loading from save.

This commit is contained in:
Storm Dragon
2026-01-18 23:37:03 -05:00
parent 489408a181
commit 5aebd94431
4 changed files with 144 additions and 7 deletions

View File

@@ -153,12 +153,12 @@ void check_scheduled_invasion() {
void attempt_daily_invasion() {
if (current_day < 2) return;
if (invasion_triggered_today || invasion_active) return;
if (invasion_roll_done_today) return;
invasion_roll_done_today = true;
if (current_hour < 6 || current_hour > 12) return;
int roll = random(1, 100);
if (roll > invasion_chance) return;
invasion_triggered_today = true;
schedule_invasion();
check_scheduled_invasion();
}
@@ -305,7 +305,6 @@ void update_time() {
check_ambience_transition();
// TODO: add resident defense using stored weapons once storage exists.
if (is_daytime && residents_count > 0 && barricade_health < BARRICADE_MAX_HEALTH && current_hour % 4 == 0) {
if (storage_meat > 0) {
int gained = add_barricade_health(residents_count);
@@ -317,12 +316,10 @@ void update_time() {
if (current_hour == 6) {
save_game_state();
}
if (current_hour == 6) {
attempt_daily_invasion();
process_daily_weapon_breakage();
attempt_daily_quest();
}
attempt_daily_invasion();
keep_base_fires_fed();
check_scheduled_invasion();
attempt_blessing();