mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- floatified DoFlagRangeTest
This commit is contained in:
parent
e8e69abdf7
commit
11ff044d87
1 changed files with 4 additions and 10 deletions
|
@ -1785,19 +1785,17 @@ void DoFlagScore(int16_t pal)
|
|||
}
|
||||
}
|
||||
|
||||
DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
|
||||
DSWActor* DoFlagRangeTest(DSWActor* actor, double range)
|
||||
{
|
||||
unsigned int stat;
|
||||
int dist, tx, ty;
|
||||
int tmin;
|
||||
|
||||
for (stat = 0; stat < SIZ(StatDamageList); stat++)
|
||||
{
|
||||
SWStatIterator it(StatDamageList[stat]);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
DISTANCE(itActor->spr.pos, actor->spr.pos, dist, tx, ty, tmin);
|
||||
if (dist > range)
|
||||
double dist = (itActor->spr.pos - actor->spr.pos).LengthSquared();
|
||||
if (dist > range * range)
|
||||
continue;
|
||||
|
||||
if (actor == itActor)
|
||||
|
@ -1812,10 +1810,6 @@ DSWActor* DoFlagRangeTest(DSWActor* actor, int range)
|
|||
if (!FAFcansee(itActor->spr.pos, itActor->sector(), actor->spr.pos, actor->sector()))
|
||||
continue;
|
||||
|
||||
dist = FindDistance3D(actor->int_pos() - itActor->int_pos());
|
||||
if (dist > range)
|
||||
continue;
|
||||
|
||||
return itActor;
|
||||
}
|
||||
}
|
||||
|
@ -2046,7 +2040,7 @@ int SetCarryFlag(DSWActor* actor)
|
|||
|
||||
int DoFlag(DSWActor* actor)
|
||||
{
|
||||
auto hitActor = DoFlagRangeTest(actor, 1000);
|
||||
auto hitActor = DoFlagRangeTest(actor, 62.5);
|
||||
|
||||
if (hitActor)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue