mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
Merge pull request #876 from plague006/fix/entity_placement_restriction
Fix logic in entity_placement_restriction
This commit is contained in:
commit
a437324592
@ -126,7 +126,14 @@ local on_built_token =
|
||||
-- Takes the keep_alive_callback function and runs it with the entity as an argument
|
||||
-- If true is returned, we exit. If false, we destroy the entity.
|
||||
local keep_alive_callback = primitives.keep_alive_callback
|
||||
if not banned_entities[name] and keep_alive_callback and keep_alive_callback(entity) then
|
||||
|
||||
-- return in these cases:
|
||||
-- not banned and no callback function
|
||||
-- not banned and callback function and saved by callback
|
||||
-- destroy in these cases:
|
||||
-- all banned ents
|
||||
-- not banned and callback function and not saved by callback
|
||||
if not banned_entities[name] and (not keep_alive_callback or keep_alive_callback(entity)) then
|
||||
return
|
||||
end
|
||||
|
||||
@ -196,7 +203,7 @@ end
|
||||
-- @param keep_alive_callback <function>
|
||||
function Public.set_keep_alive_callback(keep_alive_callback)
|
||||
if type(keep_alive_callback) ~= 'function' then
|
||||
error('Sending a non-funciton')
|
||||
error('Sending a non-function')
|
||||
end
|
||||
primitives.keep_alive_callback = keep_alive_callback
|
||||
check_event_status()
|
||||
|
Loading…
Reference in New Issue
Block a user