From 12e9fa7b48fd07f388883631222692a4f4712ec2 Mon Sep 17 00:00:00 2001 From: Nicolas Sanchez <98576999+nicolassanchez02@users.noreply.github.com> Date: Tue, 19 May 2026 08:23:25 -0500 Subject: [PATCH] Clear avatar from golf-course join barrier on disconnect avatarExited cleans up rewardBarrier when a player drops out, then tries to do the same for the wait-clients-join barrier (self.__barrier), but the guard is broken in two ways: if hasattr(self, '__barrier'): if self.__barrier: self.__.clear(avId) Python name-mangling rewrites self.__barrier inside the class body to self._DistributedGolfCourseAI__barrier, but the hasattr() string is not mangled, so hasattr(self, '__barrier') is always False. The cleanup branch never runs. The author got the same pattern right at line 256 where they wrote hasattr(self, '_DistributedGolfCourseAI__barrier'). And the inner call self.__.clear(...) is a typo for self.__barrier.clear(...) that would AttributeError if it ever fired. self.__barrier is initialized to None at line 63 and only later set to a real ToonBarrier, so the attribute always exists. Replace the broken hasattr/typo combo with a plain truthy check and the correct clear call. Effect: if a player disconnects during the 'wait for other clients to join' phase, they now get removed from the barrier so the barrier can fire with the remaining players instead of holding everyone until JOIN_TIMEOUT. --- toontown/golf/DistributedGolfCourseAI.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/toontown/golf/DistributedGolfCourseAI.py b/toontown/golf/DistributedGolfCourseAI.py index e7342a7..106477c 100644 --- a/toontown/golf/DistributedGolfCourseAI.py +++ b/toontown/golf/DistributedGolfCourseAI.py @@ -188,9 +188,8 @@ class DistributedGolfCourseAI(DistributedObjectAI.DistributedObjectAI, FSM): if hasattr(self, 'rewardBarrier'): if self.rewardBarrier: self.rewardBarrier.clear(avId) - if hasattr(self, '__barrier'): - if self.__barrier: - self.__.clear(avId) + if self.__barrier: + self.__barrier.clear(avId) def startNextHole(self): self.notify.debugStateCall(self)