try to fix gcc thinking the vectors are uninitialized

This commit is contained in:
Ricardo Luís Vaz Silva 2023-10-07 20:31:50 -03:00 committed by Christoph Oelckers
parent 04c167f181
commit bfe589fecd

View file

@ -960,14 +960,14 @@ public:
double Distance2DSquared(AActor *other, bool absolute = false)
{
DVector2 otherpos = absolute ? other->Pos().XY() : other->PosRelative(this).XY();
return (Pos().XY() - otherpos).LengthSquared();
DVector3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
return (Pos().XY() - otherpos.XY()).LengthSquared();
}
double Distance2D(AActor *other, bool absolute = false) const
{
DVector2 otherpos = absolute ? other->Pos().XY() : other->PosRelative(this).XY();
return (Pos().XY() - otherpos).Length();
DVector3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
return (Pos().XY() - otherpos.XY()).Length();
}
double Distance2D(double x, double y) const
@ -997,14 +997,14 @@ public:
DAngle AngleTo(AActor *other, bool absolute = false)
{
DVector2 otherpos = absolute ? other->Pos().XY() : other->PosRelative(this).XY();
return VecToAngle(otherpos - Pos().XY());
DVector3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
return VecToAngle(otherpos.XY() - Pos().XY());
}
DAngle AngleTo(AActor *other, double oxofs, double oyofs, bool absolute = false) const
{
DVector2 otherpos = absolute ? other->Pos().XY() : other->PosRelative(this).XY();
return VecToAngle(otherpos - Pos() + DVector2(oxofs, oyofs));
DVector3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
return VecToAngle(otherpos.XY() - Pos().XY() + DVector2(oxofs, oyofs));
}
DVector2 Vec2To(AActor *other) const