The checkMovement function takes a significantly long time to execute, proven by FTE's SSQC profiler.
|
float(float dir) checkMovement = |
|
{ |
|
makevectors(self.movement); |
|
string a = vtos(self.movement); |
|
float x, y; |
|
|
|
tokenize(a); |
|
x = stof(argv(0)); |
|
y = stof(argv(1)); |
|
|
|
switch(dir) { |
|
case forward: |
|
if (x > 0) |
|
return 1; |
|
break; |
|
case backward: |
|
if (x < 0) |
|
return 1; |
|
break; |
|
case right: |
|
if (y > 0) |
|
return 1; |
|
break; |
|
case left: |
|
if (y < 0) |
|
return 1; |
|
break; |
|
case all_move: |
|
if (x || y) |
|
return 1; |
|
break; |
|
default: |
|
return 0; |
|
} |
|
} |
The
checkMovementfunction takes a significantly long time to execute, proven by FTE's SSQC profiler.quakec/source/server/player.qc
Lines 126 to 160 in 92f38d9