Skip to content

Commit

Permalink
Fix touch called with endtouch on mapping api triggers
Browse files Browse the repository at this point in the history
This would have teleported you twice and would mess up relative teleport triggers
  • Loading branch information
GameChaos committed Oct 30, 2024
1 parent d45ff10 commit 3d8f583
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/kz/trigger/callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ void KZTriggerService::OnMappingApiTriggerStartTouchPost(TriggerTouchTracker tra
}
break;

case KZTRIGGER_ANTI_BHOP:
case KZTRIGGER_TELEPORT:
case KZTRIGGER_MULTI_BHOP:
case KZTRIGGER_SINGLE_BHOP:
Expand Down Expand Up @@ -225,7 +224,6 @@ void KZTriggerService::OnMappingApiTriggerEndTouchPost(TriggerTouchTracker track
break;

case KZTRIGGER_TELEPORT:
case KZTRIGGER_ANTI_BHOP:
case KZTRIGGER_MULTI_BHOP:
case KZTRIGGER_SINGLE_BHOP:
case KZTRIGGER_SEQUENTIAL_BHOP:
Expand Down
2 changes: 1 addition & 1 deletion src/kz/trigger/kz_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class KZTriggerService : public KZBaseService
static bool ShouldTouchBeforeEndTouch(TriggerTouchTracker tracker)
{
// TODO: Let mapping API decide whether it is not the case.
return true;
return !tracker.kzTrigger;
}

// Whether Touch should be called on every possible change in origin.
Expand Down
2 changes: 1 addition & 1 deletion src/kz/trigger/mapping_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ bool KZTriggerService::TouchTeleportTrigger(TriggerTouchTracker tracker)

this->player->SetOrigin(finalOrigin);

return shouldTeleport;
return true;
}

void KZTriggerService::ApplySlide(bool replicate)
Expand Down

0 comments on commit 3d8f583

Please sign in to comment.