Fix golf WaitReadyHole barrier cleanup guard

exitWaitReadyHole guarded its cleanup with hasattr(self, '__barrier'), but the attribute is name-mangled to _DistributedGolfCourseAI__barrier, so the check is always False and the cleanup never runs. The WaitReadyHole barrier leaks every time the FSM leaves that state.

self.__barrier is initialized to None in __init__, so guard on the value instead, matching exitWaitJoin and the handleExitedAvatar path.
This commit is contained in:
Nicolas Sanchez 2026-05-29 17:07:40 -05:00
parent a5ecbb8b1e
commit 8bad11c540
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ class DistributedGolfCourseAI(DistributedObjectAI.DistributedObjectAI, FSM):
def exitWaitReadyHole(self):
self.notify.debugStateCall(self)
if hasattr(self, '__barrier'):
if self.__barrier:
self.__barrier.cleanup()
self.__barrier = None
return