Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Server] Remove checkMovement #4

Open
MotoLegacy opened this issue Jul 2, 2022 · 0 comments
Open

[Server] Remove checkMovement #4

MotoLegacy opened this issue Jul 2, 2022 · 0 comments

Comments

@MotoLegacy
Copy link
Member

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;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant