Fixed list of persistent objects not being updated when things are removed from the level.

This commit is contained in:
Patrick Marsee 2019-05-24 14:06:34 -04:00
parent e81345e793
commit 1b41c46105
4 changed files with 13 additions and 5 deletions

View file

@ -448,7 +448,7 @@ Object can be the name of the object, or its coordinates."""
if self.level.name not in self.persist:
self.persist[self.level.name] = {}
for i in self.level.persistent:
self.persist[self.level.name][i] = self.level.getThingByName(i)
self.persist[self.level.name][i] = self.level.getThingByID(i)
preLoaded = False
if args[0] in self.persist:
@ -613,7 +613,7 @@ Object can be the name of the object, or its coordinates."""
return False
def handleTake(self, e):
self.level.removeThing(e.item.name)
self.level.removeThingByName(e.item.name)
self.playerInv[e.item.name] = e.item
return True