From b297589440cb7de756adeba21f0a5494eef4735d Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 16 Dec 2015 14:22:01 -0700 Subject: [PATCH] AI spies won't sweep for eight hours after being available. --- lib/Lacuna/AI.pm | 4 +++- var/www/public/changes.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/AI.pm b/lib/Lacuna/AI.pm index 02805438..1accc8c1 100644 --- a/lib/Lacuna/AI.pm +++ b/lib/Lacuna/AI.pm @@ -508,7 +508,9 @@ sub set_defenders { $on_sweep = 10 if ($enemies == 0); while (my $spy = $local_spies->next) { if ($spy->is_available) { - if ($spy->task eq 'Security Sweep' or $on_sweep < 10) { + if ( $spy->date_created < DateTime->now->subtract(hours => 8) and + ($spy->task eq 'Security Sweep' or $on_sweep < 10)) { + say " Spy ID: ".$spy->id." sweeping"; my $spy_result = $spy->assign('Security Sweep'); $spy->update; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 96bcc01d..03cc49c9 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -9,6 +9,7 @@ - Fix: Remove item from SST trade now shows proper hold size requirement. - UI : Add propaganda boost to the happy popup (spy icon). - UI : Promotional events show up during the event. + - Mod: AI spies get easy jobs their first shift. 3.0916: - Mod: Jackpot enhanced. -- 2.51.2