p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
MIT License
89 stars 27 forks source link

non-portalgun weapons attempt and fail to lookup m_h{Primary,Secondary}Portal fields #191

Closed p2srluma[bot] closed 6 months ago

p2srluma[bot] commented 11 months ago

https://discord.com/channels/146404426746167296/811780246608281650/1136891272674672700


This action was performed automatically, triggered by a report by discord user mlugg#0 at 04-08-2023 05:20:01 UTC.

NeKzor commented 9 months ago

Steps to reproduce: Enter this in the developer console: sv_cheats 1; give weapon_cubemap; use weapon_cubemap;

Expected outcome: No console spam and no performance issues.

What actually hapens: Console spam and performance issues.

Issue is here: https://github.com/p2sr/SourceAutoRecord/blob/b7f2c993a373311d0fae6f73f4d5a4a1af551e4f/src/Features/Speedrun/Rules.cpp#L416-L425

Proposed fix: Add a check if the active weapon is a portal gun entity.