Skip to content

Conversation

@p2r3
Copy link
Contributor

@p2r3 p2r3 commented May 2, 2025

The SpeedrunTimer::TickRules function seemingly attempts to track only those portals shot by players, as evidenced by the queries for a player handle, followed by queries for the weapon handle. However, this is not an exhaustive check, and can lead to false positives in some cases.

For example, if the player has a single-portal device, a secondary linked portal opened via map logic will still count as being owned by the player's portal gun. This is likely because the portal gun is still linked to that orange portal, despite not being able to create it. This becomes an issue in cases where SAR's demo data is used to count portal placements in custom maps.

To fix this, I've added a check for the m_hFiredByPlayer handle of the portal, which seems to only be valid when the portal has actually been fired by a player wielding a portal gun. I've tested this and confirmed that it works as intended on a workshop map that would typically be susceptible to the false positive edge case mentioned earlier.

@ThisAMJ ThisAMJ merged commit 0c6b5ea into p2sr:master May 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants