Avoid intro camera switching when only 1 trigger_camera available#873
Avoid intro camera switching when only 1 trigger_camera available#873s1lentq merged 4 commits intorehlds:masterfrom
Conversation
|
m_bMapHasCameras is unused. You can check if the next camera is available and that’s it. |
|
A better spot than |
Well I think I gave it one 😄
I mean, the caching isn't an issue, only in the fact a modder is dynamically changing |
I think it's up to the modder to also modify |
…hlds#873) * Add UTIL_CountEntities, adjust m_fIntroCamTime assignation * Moved camera count caching to CheckLevelInitialized
This PR omits the logic that changes the player's introduction camera to it (the same), which forces a rather annoying change of angles because there is no behavior that verifies if there is more than just one trigger_camera.
m_bMapHasCamerasmember fromCSGameRuleschanged type toint, which is the same asBOOLinternally, and it counts the number oftrigger_cameraentities in the map.ClientPutInServer.CSGameRulesclass is now -1 (ToDo: I don't think I need to enclose that with the fixes macro).m_fIntroCamTimeis assigned to 0.0 if there's just only onetrigger_camera, so it wont force an unnecesary camera updating every 6 seconds. A simple condition was added in the related thinking functionJoiningThink.CheckLevelInitializedon the counting ofinfo_player_*entities using the added functionUTIL_CountEntities.