From 8f1f46cfae289d1a03047a204a5578524495218d Mon Sep 17 00:00:00 2001 From: Open Toontown <57279094+opentoontown@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:15:31 -0500 Subject: [PATCH] toon: Fix camera lerp for DistributedNPCFisherman --- toontown/toon/DistributedNPCFisherman.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/toontown/toon/DistributedNPCFisherman.py b/toontown/toon/DistributedNPCFisherman.py index bd99fbf..c7bd8e9 100644 --- a/toontown/toon/DistributedNPCFisherman.py +++ b/toontown/toon/DistributedNPCFisherman.py @@ -16,12 +16,15 @@ class DistributedNPCFisherman(DistributedNPCToonBase): self.button = None self.popupInfo = None self.fishGui = None + self.lerpCameraSeq = None return def disable(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupFishGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.popupInfo: self.popupInfo.destroy() self.popupInfo = None @@ -73,7 +76,9 @@ class DistributedNPCFisherman(DistributedNPCToonBase): def resetFisherman(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupFishGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.fishGui: self.fishGui.destroy() self.fishGui = None @@ -93,7 +98,9 @@ class DistributedNPCFisherman(DistributedNPCToonBase): if mode == NPCToons.SELL_MOVIE_CLEAR: return if mode == NPCToons.SELL_MOVIE_TIMEOUT: - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.isLocalToon: self.ignore(self.fishGuiDoneEvent) if self.popupInfo: @@ -113,7 +120,10 @@ class DistributedNPCFisherman(DistributedNPCToonBase): self.setupAvatars(self.av) if self.isLocalToon: camera.wrtReparentTo(render) - camera.lerpPosHpr(-5, 9, base.localAvatar.getHeight() - 0.5, -150, -2, 0, 1, other=self, blendType='easeOut', task=self.uniqueName('lerpCamera')) + quat = Quat() + quat.setHpr((-150, -2, 0)) + self.lerpCameraSeq = camera.posQuatInterval(1, Point3(-5, 9, base.localAvatar.getHeight() - 0.5), quat, other=self, blendType='easeOut', name=self.uniqueName('lerpCamera')) + self.lerpCameraSeq.start() if self.isLocalToon: taskMgr.doMethodLater(1.0, self.popupFishGUI, self.uniqueName('popupFishGUI')) elif mode == NPCToons.SELL_MOVIE_COMPLETE: