View Single Post
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-18-2012 , 20:24   Re: [TF2] TF2Fix 1.0
Reply With Quote #9

Quote:
Originally Posted by Powerlord View Post
Just looked at the code for a sec after a person I was talking to mentioned its timers...

There's a serious need for optimization in the millisecond timer (which is actually every tenth second, not millisecond). I see repeated calls to TF2_GetPlayerClass(z) and GetEntPropEnt(z, Prop_Send, "m_hActiveWeapon"). These really should be called once and have their values stored in a variable.

For that matter, TF2_GetPlayerClass returns an enum value, so it can be used in a switch statement.
I didn't think that repeatedly calling those was so bad, but I guess I can change 'em. The timer's called "millisecond" because I've never seen the terms "centisecond" or "decisecond" used anywhere.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline