Sentry and Dispenser will sanitize the angles it inherits from the player now.

This commit is contained in:
Marco Cawthorne 2023-01-18 21:04:56 -08:00
parent c1d8d69a77
commit c9869626cc
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 11 additions and 2 deletions

View File

@ -222,7 +222,9 @@ TFCDispenser::Touch(entity eToucher)
void
TFCDispenser::Place(player pl)
{
SetAngles(pl.GetAngles());
vector newAngles = pl.GetAngles();
newAngles[0] = newAngles[2] = 0;
SetAngles(newAngles);
makevectors([0, pl.v_angle[1], 0]);
SetOrigin(pl.origin + (v_forward * 48));

View File

@ -27,6 +27,11 @@ TFCSentry::Think(void)
if (vlen(origin - p.origin) > 1024)
continue;
print(sprintf("Is Facing? %d\n", IsFacing(p)));
if (IsFacing(p) == false)
continue;
/* find them */
traceline(origin, p.origin, MOVE_NORMAL, this);
if (trace_ent == p) {
@ -71,7 +76,9 @@ TFCSentry::Think(void)
void
TFCSentry::Place(NSClientPlayer pl)
{
SetAngles(pl.GetAngles());
vector newAngles = pl.GetAngles();
newAngles[0] = newAngles[2] = 0;
SetAngles(newAngles);
makevectors([0, pl.v_angle[1], 0]);
SetOrigin(pl.origin + (v_forward * 48));