Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix split/cp/stage zones being shared by all courses #276

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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