mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-19 13:24:12 -04:00
Add SQUARE macro to improve readibility for distances
This commit is contained in:
@@ -321,7 +321,7 @@ BOOL daNh_c::checkEscapeEnd() {
|
||||
setAction(&daNh_c::waitAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
if (homeDelta.abs2XZ() > l_HIO.prm.mMaxHomeDist*l_HIO.prm.mMaxHomeDist) {
|
||||
if (homeDelta.abs2XZ() > SQUARE(l_HIO.prm.mMaxHomeDist)) {
|
||||
setAction(&daNh_c::returnAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ BOOL daNh_c::returnAction(void*) {
|
||||
} else {
|
||||
s16 targetAngle = cLib_targetAngleY(¤t.pos, &home.pos);
|
||||
cXyz homeDelta = home.pos - current.pos;
|
||||
if (homeDelta.abs2XZ() < l_HIO.prm.mMaxHomeDist*l_HIO.prm.mMaxHomeDist) {
|
||||
if (homeDelta.abs2XZ() < SQUARE(l_HIO.prm.mMaxHomeDist)) {
|
||||
s16 angle = targetAngle - fopAcM_searchPlayerAngleY(this);
|
||||
if (abs(angle) < 0x1000) {
|
||||
if (angle < 0) {
|
||||
|
||||
Reference in New Issue
Block a user