Prevent doors closing through occupants
This commit is contained in:
parent
bf09a8844a
commit
9731202739
5 changed files with 108 additions and 6 deletions
|
|
@ -10,10 +10,10 @@ function WiredDoor:initialize(x, y, color, circuitId)
|
|||
self.wired = true
|
||||
end
|
||||
|
||||
function WiredDoor:setPowered(powered)
|
||||
function WiredDoor:setPowered(powered, canClose)
|
||||
if powered then
|
||||
if self.locked then self:unlock() end
|
||||
elseif not self.locked then
|
||||
elseif canClose ~= false and not self.locked then
|
||||
self:lock()
|
||||
end
|
||||
self:refreshSprites()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue