Fix: check starting_age <= age, instead of starting_age < age. Otherwise we can get into an infinite loop.

This commit is contained in:
Twan van Laarhoven
2020-05-07 02:56:43 +02:00
parent 26f35893ae
commit 360f8d71ad
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ void SetScriptManager::updateRecursive(deque<ToUpdate>& to_update, Age starting_
void SetScriptManager::updateToUpdate(const ToUpdate& u, deque<ToUpdate>& to_update, Age starting_age) {
Age age = u.value->last_script_update;
if (starting_age < age) return; // this value was already updated
if (starting_age <= age) return; // this value was already updated
Context& ctx = getContext(u.card);
bool changes = false;
try {
+2
View File
@@ -40,6 +40,8 @@ public:
/// Compare two ages, smaller means earlier
inline bool operator < (Age a) const { return age < a.age; }
/// Compare two ages
inline bool operator <= (Age a) const { return age <= a.age; }
/// Compare two ages
inline bool operator == (Age a) const { return age == a.age; }
/// A number corresponding to the age