Skip to content

Commit

Permalink
Fix timer zones being shared by all courses (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
GameChaos authored Nov 17, 2024
1 parent b54d33b commit e32df41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/kz/mappingapi/kz_mappingapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,16 @@ void KZ::mapapi::OnRoundStart()
FOR_EACH_VEC(g_mappingApi.triggers, i)
{
KzTrigger *trigger = &g_mappingApi.triggers[i];
if (!KZ::mapapi::IsTimerTrigger(trigger->type))
{
continue;
}

if (!KZ_STREQ(trigger->zone.courseDescriptor, courseDescriptor->entityTargetname))
{
continue;
}

switch (trigger->type)
{
case KZTRIGGER_ZONE_SPLIT:
Expand Down
6 changes: 3 additions & 3 deletions src/kz/timer/kz_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void KZTimerService::StartZoneEndTouch(const KZCourseDescriptor *course)

void KZTimerService::SplitZoneStartTouch(const KZCourseDescriptor *course, i32 splitNumber)
{
if (!this->GetTimerRunning())
if (!this->timerRunning || course->course->guid != this->currentCourseGUID)
{
return;
}
Expand All @@ -123,7 +123,7 @@ void KZTimerService::SplitZoneStartTouch(const KZCourseDescriptor *course, i32 s

void KZTimerService::CheckpointZoneStartTouch(const KZCourseDescriptor *course, i32 cpNumber)
{
if (!this->GetTimerRunning())
if (!this->timerRunning || course->course->guid != this->currentCourseGUID)
{
return;
}
Expand All @@ -142,7 +142,7 @@ void KZTimerService::CheckpointZoneStartTouch(const KZCourseDescriptor *course,

void KZTimerService::StageZoneStartTouch(const KZCourseDescriptor *course, i32 stageNumber)
{
if (!this->GetTimerRunning())
if (!this->timerRunning || course->course->guid != this->currentCourseGUID)
{
return;
}
Expand Down

0 comments on commit e32df41

Please sign in to comment.