diff --git a/changelog.txt b/changelog.txt index 56f3249..86d263b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,7 +8,7 @@ Date: ???? - Change surface regrowth checkboxes to be enabled/disabled by the global setting to make it obvious that they are dependent on the global setting. Bugfixes: - Fix regrowth surface setting not respecting previous setting state when surface is first created. - - Fix offline enemy attack error when attacks target a player character. + - Remove offline enemy attack error messages. (Not really a bug, just false error messages.) Info: - Add RU translation (thanks KORESHon!) --------------------------------------------------------------------------------------------------- diff --git a/lib/offline_protection.lua b/lib/offline_protection.lua index db14e95..3ad9183 100644 --- a/lib/offline_protection.lua +++ b/lib/offline_protection.lua @@ -60,16 +60,14 @@ function OarcModifyEnemyGroup(event) -- No targets found with a last_user if (target_entity == nil) then + -- There are 2 Known cases where this can happen: + -- Either (group.command.type == defines.command.attack_area) in which case it is likely a player attacking bases with nukes. + -- OR + -- The enemy group is just expanding / building bases. - -- This is unexpected, not sure under which conditions this would happen. - if (group.command.type == defines.command.attack_area) then - -- SendBroadcastMsg("OarcModifyEnemyGroup find_nearest_enemy attack_area FAILED!?!? " .. GetGPStext(group.surface.name, group.position) .. " Target: " .. GetGPStext(group.surface.name, group.command.destination)) - log("ERROR - OarcModifyEnemyGroup find_nearest_enemy attack_area FAILED!?!?" .. serpent.block(group)) + -- If we really have an edge case, then so be it, let it go through. - -- This is fine, as the enemy group is just expanding / building bases - else - -- log("OarcModifyEnemyGroup find_nearest_enemy did not find anything!") - end + -- In both cases, we don't want to stop the enemy group. return end