mirror of https://github.com/AxioDL/metaforce.git
CDrone: Fix detection range in SpotPlayer
This commit is contained in:
parent
04a377c68e
commit
3659bedad1
|
@ -803,13 +803,13 @@ bool CDrone::InRange(CStateManager& mgr, float arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDrone::SpotPlayer(CStateManager& mgr, float arg) {
|
bool CDrone::SpotPlayer(CStateManager& mgr, float arg) {
|
||||||
if ((mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared() > x3bc_detectionRange)
|
if ((mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared() > x3bc_detectionRange * x3bc_detectionRange)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!LineOfSight(mgr, arg))
|
if (!LineOfSight(mgr, arg))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (GetTransform().basis[1] + x5cc_ * GetTransform().basis[0])
|
return (GetTransform().frontVector() + x5cc_ * GetTransform().rightVector())
|
||||||
.normalized()
|
.normalized()
|
||||||
.dot((mgr.GetPlayer().GetAimPosition(mgr, 0.f) - GetTranslation()).normalized()) > 0.5f;
|
.dot((mgr.GetPlayer().GetAimPosition(mgr, 0.f) - GetTranslation()).normalized()) > 0.5f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue