Commit 5689407f authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

small cleanup in conveyer

parent 1b96962d
...@@ -149,17 +149,19 @@ class Conveyer(CoreObject): ...@@ -149,17 +149,19 @@ class Conveyer(CoreObject):
else: else:
moveTime1=(self.length-self.position[0])/self.speed moveTime1=(self.length-self.position[0])/self.speed
self.position[0]=self.length self.position[0]=self.length
self.entityLastReachedEnd=self.Res.activeQ[0] self.entityLastReachedEnd=self.getActiveObjectQueue()[0]
self.timeLastEntityReachedEnd=now() self.timeLastEntityReachedEnd=now()
self.timeLastEntityEnded=now()
#for the other entities #for the other entities
for i in range(1,len(self.Res.activeQ)): for i in range(1,len(self.getActiveObjectQueue())):
#if it does not reach the preceding entity move it according to speed #if it does not reach the preceding entity move it according to speed
if self.position[i]+interval*self.speed<self.position[i-1]-self.getActiveObjectQueue()[i].length: if self.position[i]+interval*self.speed<self.position[i-1]-self.getActiveObjectQueue()[i].length:
moveTime2=interval moveTime2=interval
self.position[i]=self.position[i]+interval*self.speed self.position[i]=self.position[i]+interval*self.speed
#else move it right before the preceding entity #else move it right before the preceding entity
else: else:
mTime=(self.position[i-1]-self.Res.activeQ[i].length-self.position[i])/self.speed mTime=(self.position[i-1]-self.getActiveObjectQueue()[i].length-self.position[i])/self.speed
if mTime>moveTime2: if mTime>moveTime2:
moveTime2=mTime moveTime2=mTime
self.position[i]=self.position[i-1]-self.getActiveObjectQueue()[i-1].length self.position[i]=self.position[i-1]-self.getActiveObjectQueue()[i-1].length
......
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