diff --git a/toontown/racing/RaceManagerAI.py b/toontown/racing/RaceManagerAI.py index c405137..46b30c6 100644 --- a/toontown/racing/RaceManagerAI.py +++ b/toontown/racing/RaceManagerAI.py @@ -322,7 +322,7 @@ class RaceManagerAI(DirectObject.DirectObject): self.notify.debug('already has grandtouring') self.notify.debug('trophies %s' % trophies) self.notify.debug('GrandTouring: already has grand touring %s' % trophies[RaceGlobals.GrandTouring]) - for i in range(1, RaceGlobals.NumTrophies / RaceGlobals.TrophiesPerCup + 1): + for i in range(1, RaceGlobals.NumTrophies // RaceGlobals.TrophiesPerCup + 1): cupNum = (trophies[:RaceGlobals.NumTrophies].count(1) + addTrophyCount) / (i * RaceGlobals.TrophiesPerCup) self.notify.debug('cupNum: %s' % cupNum) trophyIndex = RaceGlobals.TrophyCups[i - 1] diff --git a/toontown/racing/Racer.py b/toontown/racing/Racer.py index c2d1036..5f9c31a 100644 --- a/toontown/racing/Racer.py +++ b/toontown/racing/Racer.py @@ -1,3 +1,6 @@ +from direct.distributed.ClockDelta import globalClockDelta + + class Racer: def __init__(self, race, air, avId, zoneId): @@ -9,4 +12,15 @@ class Racer: self.avatar.takeOutKart(self.zoneId) self.kart = self.avatar.kart self.finished = False + self.maxLap = 0 + self.lapT = 0.0 + self.baseTime = 0.0 + self.totalTime = 0.0 + self.exited = False self.exitEvent = self.air.getAvatarExitEvent(self.avId) + self.race.accept(self.exitEvent, self.race.unexpectedExit, [self.avId]) + + def setLapT(self, numLaps, t, timestamp): + self.maxLap = numLaps + self.lapT = t + self.totalTime = globalClockDelta.networkToLocalTime(timestamp) - self.baseTime