fix(Core/Game): Rest & Inn Improvements (#3780)

This commit is contained in:
Meltie2013
2020-12-11 08:23:09 -06:00
committed by GitHub
parent aff02b0599
commit af53598fa2
5 changed files with 73 additions and 56 deletions

View File

@@ -1335,7 +1335,7 @@ bool Position::IsWithinBox(const Position& center, float xradius, float yradius,
// is-in-cube check and we have to calculate only one point instead of 4
// 2PI = 360*, keep in mind that ingame orientation is counter-clockwise
double rotation = 2 * M_PI - center.GetOrientation();
double rotation = 2 * M_PI - GetOrientation();
double sinVal = std::sin(rotation);
double cosVal = std::cos(rotation);
@@ -1347,13 +1347,14 @@ bool Position::IsWithinBox(const Position& center, float xradius, float yradius,
// box edges are parallel to coordiante axis, so we can treat every dimension independently :D
float dz = GetPositionZ() - center.GetPositionZ();
float dx = rotX - center.GetPositionX();
float dy = rotY - center.GetPositionY();
float dx = rotX - GetPositionX();
float dy = rotY - GetPositionY();
if ((std::fabs(dx) > xradius) ||
(std::fabs(dy) > yradius) ||
(std::fabs(dz) > zradius))
(std::fabs(dy) > yradius) ||
(std::fabs(dz) > zradius))
{
return false;
}
return true;
}