Code: Select all
-- Setup as the curent player
actor.player = true
game.paused = actor:enoughEnergy()
game.player = actor
game.uiset.hotkeys_display.actor = actor
Map:setViewerActor(actor)
if game.target then game.target.source_actor = actor end
if game.level and actor.x and actor.y then game.level.map:moveViewSurround(actor.x, actor.y, 8, 8) end
actor._move_others = actor.move_others
actor.move_others = true
-- Change back the old actor to a normal actor
if oldp and oldp ~= actor then
if self.members[oldp] and self.members[oldp].on_uncontrol then self.members[oldp].on_uncontrol(oldp) end
if oldp.__PREVIOUS_CLASSNAME then
local uid = oldp.uid
oldp.replacedWith = false
oldp:replaceWith(require(oldp.__PREVIOUS_CLASSNAME).new(oldp))
oldp.replacedWith = nil
oldp.uid = uid
__uids[uid] = oldp
end
actor.move_others = actor._move_others --Here?!?
oldp.changed = true
oldp.player = nil
if game.level and oldp.x and oldp.y then oldp:move(oldp.x, oldp.y, true) end
end