Skip to content
Snippets Groups Projects
Commit ca529ccf authored by DarkGod's avatar DarkGod
Browse files

Opening a door triggers a "on_door_opened" event on all entities at the same spot on the map

parent 0136c5ef
No related branches found
No related tags found
No related merge requests found
......@@ -1694,7 +1694,7 @@ function _M:setupCommands()
print("===============")
end end,
[{"_g","ctrl"}] = function() if config.settings.cheat then
self:changeLevel(1, "orcs+krimbul")
self:changeLevel(4, "orcs+krimbul")
do return end
local o = game.zone:makeEntity(game.level, "object", {subtype="steamsaw", random_object=true}, nil, true)
if o then
......
......@@ -64,6 +64,7 @@ function _M:block_move(x, y, e, act, couldpass)
if ret then
game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened])
game:playSoundNear({x=x,y=y}, self.door_sound or {"ambient/door_creaks/creak_%d",1,4})
game.level.map:checkAllEntities(x, y, "on_door_opened", e)
if game.level.map.attrs(x, y, "vault_id") and e.openVault then e:openVault(game.level.map.attrs(x, y, "vault_id")) end
end
......@@ -76,6 +77,7 @@ function _M:block_move(x, y, e, act, couldpass)
else
game.level.map(x, y, engine.Map.TERRAIN, game.zone.grid_list[self.door_opened])
game:playSoundNear({x=x,y=y}, self.door_sound or {"ambient/door_creaks/creak_%d",1,4})
game.level.map:checkAllEntities(x, y, "on_door_opened", e)
if game.level.map.attrs(x, y, "vault_id") and e.openVault then e:openVault(game.level.map.attrs(x, y, "vault_id")) end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment