Hello,
which one of the following "pseudo" codes is better/faster?
first: having local variables in OnGameFrame, but fast variable accesses ...
PHP Code:
public OnGameFrame() {
new Float:PlayerVel[3];
for( new client = 1 ; client <= MAXPLAYERS ; client++ ) {
GetEntPropVector(client, Prop_Data, "m_vecOrigin", PlayerVel);
for ( new i = 0 ; i < 1000000 ; i++ ) PlayerVel[0] += 10;
}
}
second: global variables instead of local ones, but a lot of array indexes ...
PHP Code:
new Float:PlayerVel[MAXPLAYERS][3];
public OnGameFrame() {
for( new client = 1 ; client <= MAXPLAYERS ; client++ ) {
GetEntPropVector(client, Prop_Data, "m_vecOrigin", PlayerVel[client]);
for ( new i = 0 ; i < 1000000 ; i++ ) PlayerVel[client][0] += 10;
}
}
thx for help
__________________