mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-01-05 22:53:48 +02:00
This should stop robots randomly being killed! Thanks vfinn!
https://github.com/vfinn
e8901005a1
This commit is contained in:
parent
35a841898a
commit
275b2350e0
@ -26,6 +26,14 @@ MAX_INT32_NEG = -2147483648
|
||||
-- General Helper Functions
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Tests if a string contains a given substring
|
||||
-- @param s the string to check for the substring
|
||||
-- @param ends the substring to test for
|
||||
-- @return true if the substring was found in the string
|
||||
function string.contains(s, ends)
|
||||
return s and string.find(s, ends) ~= nil
|
||||
end
|
||||
|
||||
-- Prints flying text.
|
||||
-- Color is optional
|
||||
function FlyingText(msg, pos, color, surface)
|
||||
|
@ -361,7 +361,7 @@ function WorldEaterSingleStep()
|
||||
|
||||
if (total_count > 0) then
|
||||
for k,v in pairs(entities) do
|
||||
if (v.last_user or (v.type == "character")) then
|
||||
if (v.last_user or (v.type == "character") or string.contains(v.type, "robot")) then
|
||||
has_last_user_set = true
|
||||
return -- This means we're done checking this chunk.
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user