Fixed list of persistent objects not being updated when things are removed from the level.
This commit is contained in:
parent
e81345e793
commit
1b41c46105
4 changed files with 13 additions and 5 deletions
|
@ -697,7 +697,7 @@ list of lists of tuples."""
|
|||
self.thingNames[thing.name].append(thing.thingID)
|
||||
self.things[thing.thingID] = thing
|
||||
if persist:
|
||||
self.persistent.append(thing.name)
|
||||
self.persistent.append(thing.thingID)
|
||||
return nextThing
|
||||
|
||||
def getThing(self, **kwargs):
|
||||
|
@ -889,6 +889,8 @@ The closeEnough parameter will create a path that lands beside the source if nec
|
|||
self.thingNames[oldName].remove(thing.thingID)
|
||||
if len(self.thingNames[oldName]) == 0:
|
||||
del self.thingNames[oldName]
|
||||
if thing.thingID in self.persistent:
|
||||
self.persistent.remove(thing.thingID)
|
||||
del self.things[thing.thingID]
|
||||
return thing
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue