Exit, if no router is initiated the removeEntity() does not remove entities...

Exit, if no router is initiated the removeEntity() does not remove entities from pendingEntities list. Static clear() not used for the moment
parent e436b3ea
......@@ -102,11 +102,13 @@ class Exit(CoreObject):
activeEntity = CoreObject.getEntity(self) #run the default method
# if the entity is in the G.pendingEntities list then remove it from there
from Globals import G
# if activeEntity in G.pendingEntities:
# G.pendingEntities.remove(activeEntity)
# G.pendingEntities[:]=(entity for entity in G.pendingEntities if not entity is activeEntity)
if G.Router:
if activeEntity in G.pendingEntities:
G.pendingEntities.remove(activeEntity)
# if activeEntity in G.EntityList:
# G.EntityList.remove(activeEntity)
self.clear(activeEntity)
# self.clear(activeEntity)
self.totalLifespan+=now()-activeEntity.startTime #Add the entity's lifespan to the total one.
self.numOfExits+=1 # increase the exits by one
self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits # add the number of units that xited
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment