File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ CNEO_Player::CNEO_Player()
556556 m_flLastAirborneJumpOkTime = 0 ;
557557 m_flLastSuperJumpTime = 0 ;
558558 m_botThermOpticCamoDisruptedTimer.Invalidate ();
559- m_mapPlayerFogCache. SetLessFunc ( DefLessFunc ( int ) );
559+
560560
561561 m_bFirstDeathTick = true ;
562562 m_bCorpseSet = false ;
@@ -1280,16 +1280,12 @@ bool CNEO_Player::IsHiddenByFog(CBaseEntity* target) const
12801280
12811281 // Check visibility cache for this player
12821282 int playerIndex = targetPlayer->entindex ();
1283- int cacheIndex = m_mapPlayerFogCache.Find (playerIndex);
1284-
1285- // Ensure an entry exists for this player in the cache
1286- if (cacheIndex == m_mapPlayerFogCache.InvalidIndex ())
1283+ if (!IsIndexIntoPlayerArrayValid (playerIndex))
12871284 {
1288- cacheIndex = m_mapPlayerFogCache.Insert (playerIndex, CNEO_Player_FogCacheEntry ());
1289- Assert (cacheIndex != m_mapPlayerFogCache.InvalidIndex ());
1285+ return false ;
12901286 }
12911287
1292- CNEO_Player_FogCacheEntry& cacheEntry = m_mapPlayerFogCache. Element (cacheIndex) ;
1288+ CNEO_Player_FogCacheEntry& cacheEntry = m_playerFogCache[playerIndex] ;
12931289
12941290 // If cache is fresh (within 200ms human reaction time), use cached boolean result
12951291 if (gpGlobals->curtime - cacheEntry.m_flUpdateTime < 0 .2f ) // 200ms cache window
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ class INEOPlayerAnimState;
1111#include " simtimer.h"
1212#include " soundenvelope.h"
1313#include " utldict.h"
14- #include " utlmap.h"
1514#include " hl2mp_player.h"
1615#include " in_buttons.h"
1716
@@ -337,7 +336,7 @@ class CNEO_Player : public CHL2MP_Player
337336 bool m_bSpectatorTakeoverPlayerPending{false };
338337
339338 // Cache for GetFogObscuredRatio for each player
340- mutable CUtlMap< int , CNEO_Player_FogCacheEntry> m_mapPlayerFogCache ;
339+ mutable CNEO_Player_FogCacheEntry m_playerFogCache[MAX_PLAYERS_ARRAY_SAFE] ;
341340
342341private:
343342 CNEO_Player (const CNEO_Player&);
You can’t perform that action at this time.
0 commit comments