Closed mlugg closed 1 year ago
The only issue here is that server->FindPortal
is, well, on the server. The crosshair is client-side, and I think setting the handle to a server entity would make the game very unhappy. Even if that works, it surely wouldn't work for orange?
You make a very good point!
We might need a different approach, then. When the portal handle is NULL, scan through all the client entities for open prop_portal
s with the correct linkage ID, and use those instead. This handles can be safely cached off (check again if the entities die or if the portal is ever closed), so no major perf issue.
with that being said, lemme check how default quickhud does it first lol
okay scratch that there's literally just separate networked fields that indicate each portal position that's stupid
It's trying to fetch
m_h{Primary,Secondary}Portal
from the gun. That's a good fast check, but those handles aren't saved, so if that fails, we should actually try to find theprop_portal
with the gun's linkage ID (seeserver->FindPortal
, e.g. inFeatures/PlacementScanner.cpp
).