Prevent doors closing through occupants

This commit is contained in:
Your Name 2026-08-12 00:21:53 -04:00
parent bf09a8844a
commit 9731202739
5 changed files with 108 additions and 6 deletions

View file

@ -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()