diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index d1269039b6c4922351d8261c740a90c07c44d48f..9bd5e3b9e30978181b5c1d147e7f3d784ce225a9 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -879,6 +879,16 @@ function _M:changeLevel(lev, zone, params) end if popup then popup:done() end + + self:dieClonesDie() +end + +function _M:dieClonesDie() + if not self.level then return end + local p = self:getPlayer(true) + for uid, e in pairs(self.level.entities) do + if p.puuid == e.puuid and e ~= p then self.level:removeEntity(e) end + end end function _M:getPlayer(main) @@ -1045,6 +1055,9 @@ function _M:onTurn() self.log(self.calendar:getTimeDate(self.turn)) self.day_of_year = self.calendar:getDayOfYear(self.turn) end + + if self.turn % 500 ~= 0 then return end + self:dieClonesDie() end function _M:updateFOV() diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 1134511d38eae22a56b7b34cdc54ac9b622cb2df..05a34f529f83c16d9a48325d7a30ece61ab83c64 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -90,6 +90,7 @@ function _M:init(t, no_default) self.descriptor = self.descriptor or {} self.died_times = self.died_times or {} self.last_learnt_talents = self.last_learnt_talents or { class={}, generic={} } + self.puuid = self.puuid or util.uuid() end function _M:onBirth(birther)