mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 06:07:57 +03:00
Refactored ScriptThread::EventPointsWithinDist for more clarity
This commit is contained in:
parent
054201bea9
commit
06dab5d8b0
1 changed files with 8 additions and 4 deletions
|
@ -4183,12 +4183,16 @@ void ScriptThread::EventAIsCloserThanBToC(Event *ev)
|
|||
void ScriptThread::EventPointsWithinDist(Event *ev)
|
||||
{
|
||||
Vector delta;
|
||||
float dist = ev->GetFloat(3);
|
||||
|
||||
delta = ev->GetVector(1) - ev->GetVector(2);
|
||||
Vector v1, v2;
|
||||
float fDistance;
|
||||
|
||||
v1 = ev->GetVector(1);
|
||||
v2 = ev->GetVector(2);
|
||||
fDistance = ev->GetFloat(3);
|
||||
delta = v1 - v2;
|
||||
|
||||
// check squared distance
|
||||
ev->AddInteger(((delta * delta) < (dist * dist)));
|
||||
ev->AddInteger(delta.lengthSquared() < Square(fDistance));
|
||||
}
|
||||
|
||||
bool ScriptThread::CanScriptTracePrint(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue