seven, must have been me explaining badly or something.
checking cvar() is bad. cvar_string is worse (strings always are).
but float autocvars are fast to access - direct access gives little overhead other than an extra qc opcode for the && or whatever.
you should avoid cvars in spawn functions, of course, due to saved game issues, but autocvars are always the preferable way to access cvars (assuming you're guarenteed to be running in an engine that supports them).
The ideal fix would be to use csqc, and to simply not draw the local player. which means that it still works properly in deathmatch/coop/cammed demos.
alternatively, a less comprehensive fix for deathmatch/coop would be to use customizeentityforplayer.
really there is no truely comprehensive fix, other than to have the player model visible outside of mirrors/reflections too (with eye positions fixed to cope) which is quite an extensive change and would be kinda weird/annoying in a game.
checking cvar() is bad. cvar_string is worse (strings always are).
but float autocvars are fast to access - direct access gives little overhead other than an extra qc opcode for the && or whatever.
you should avoid cvars in spawn functions, of course, due to saved game issues, but autocvars are always the preferable way to access cvars (assuming you're guarenteed to be running in an engine that supports them).
The ideal fix would be to use csqc, and to simply not draw the local player. which means that it still works properly in deathmatch/coop/cammed demos.
alternatively, a less comprehensive fix for deathmatch/coop would be to use customizeentityforplayer.
really there is no truely comprehensive fix, other than to have the player model visible outside of mirrors/reflections too (with eye positions fixed to cope) which is quite an extensive change and would be kinda weird/annoying in a game.
Comment