mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-10 22:51:36 +00:00
FTE/SERVER: Stop doing a bunch of nonsense for checkMovement vectors
This commit is contained in:
parent
e74e3fb9dd
commit
93d2e7db1a
1 changed files with 6 additions and 14 deletions
|
@ -130,33 +130,25 @@ void() playgetup10 =[ 11, playgetup10 ] {self.frame = 48;}
|
|||
|
||||
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)
|
||||
if (self.movement_x > 0)
|
||||
return 1;
|
||||
break;
|
||||
case backward:
|
||||
if (x < 0)
|
||||
if (self.movement_x < 0)
|
||||
return 1;
|
||||
break;
|
||||
case right:
|
||||
if (y > 0)
|
||||
if (self.movement_y > 0)
|
||||
return 1;
|
||||
break;
|
||||
case left:
|
||||
if (y < 0)
|
||||
if (self.movement_y < 0)
|
||||
return 1;
|
||||
break;
|
||||
case all_move:
|
||||
if (x || y)
|
||||
if (self.movement_x || self.movement_y)
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue