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
|
@ -129,34 +129,26 @@ void() playgetup10 =[ 11, playgetup10 ] {self.frame = 48;}
|
||||||
#define all_move -1
|
#define all_move -1
|
||||||
|
|
||||||
float(float dir) checkMovement =
|
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) {
|
switch(dir) {
|
||||||
case forward:
|
case forward:
|
||||||
if (x > 0)
|
if (self.movement_x > 0)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case backward:
|
case backward:
|
||||||
if (x < 0)
|
if (self.movement_x < 0)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case right:
|
case right:
|
||||||
if (y > 0)
|
if (self.movement_y > 0)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case left:
|
case left:
|
||||||
if (y < 0)
|
if (self.movement_y < 0)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case all_move:
|
case all_move:
|
||||||
if (x || y)
|
if (self.movement_x || self.movement_y)
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue