From 2463b5cff87606121c40c25657068a60e7dbd24b Mon Sep 17 00:00:00 2001 From: John Date: Tue, 30 Jun 2015 12:30:03 +0300 Subject: [PATCH] Music Tempo now changes in the races like in TTO --- toontown/racing/DistributedRace.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/toontown/racing/DistributedRace.py b/toontown/racing/DistributedRace.py index d3b2e143..c832d8f4 100755 --- a/toontown/racing/DistributedRace.py +++ b/toontown/racing/DistributedRace.py @@ -550,14 +550,14 @@ class DistributedRace(DistributedObject.DistributedObject): newLapT = (newT - self.startT) / self.curve.getMaxT() % 1.0 if newLapT - self.currLapT < -0.5: self.laps += 1 - self.changeMusicTempo(1 + self.laps * 0.5) + self.changeMusicTempo(1 + self.laps * 0.33) self.notify.debug('crossed the start line: %s, %s, %s, %s' % (self.laps, self.startT, self.currT, newT)) elif newLapT - self.currLapT > 0.5: self.laps -= 1 - self.changeMusicTempo(1 + self.laps * 0.5) + self.changeMusicTempo(1 + self.laps * 0.33) self.notify.debug('crossed the start line - wrong way: %s, %s, %s, %s' % (self.laps, self.startT, self.currT, @@ -1211,12 +1211,9 @@ class DistributedRace(DistributedObject.DistributedObject): self.musicTrack.start() def changeMusicTempo(self, newPR): - return # TODO: Reenable when we have music change support. if self.musicTrack: self.musicTrack.finish() - curPR = self.raceMusic.getPlayRate() - interval = LerpFunctionInterval(self.raceMusic.setPlayRate, fromData=curPR, toData=newPR, duration=3) - self.musicTrack = Sequence(interval) + self.musicTrack = Sequence(LerpFunctionInterval(self.raceMusic.setPlayRate, fromData=self.raceMusic.getPlayRate(), toData=newPR, duration=3)) self.musicTrack.start() def setRaceZone(self, zoneId, trackId):