mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- handle all remaining StatIterators.
This commit is contained in:
parent
69223af7b0
commit
df5d980f79
3 changed files with 11 additions and 14 deletions
|
@ -550,7 +550,6 @@ DoHornetDeath(DSWActor* actor)
|
|||
int DoCheckSwarm(DSWActor* actor)
|
||||
{
|
||||
USER* u = actor->u();
|
||||
int i;
|
||||
SPRITEp sp = &actor->s(), tsp;
|
||||
USERp tu;
|
||||
int dist, pdist, a,b,c;
|
||||
|
@ -572,10 +571,9 @@ int DoCheckSwarm(DSWActor* actor)
|
|||
return 0;
|
||||
|
||||
// all enemys
|
||||
StatIterator it(STAT_ENEMY);
|
||||
while ((i = it.NextIndex()) >= 0)
|
||||
SWStatIterator it(STAT_ENEMY);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
auto itActor = &swActors[i];
|
||||
tsp = &itActor->s();
|
||||
tu = itActor->u();
|
||||
|
||||
|
|
|
@ -351,16 +351,15 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, int16_t sects,
|
|||
|
||||
int GetZadjustment(short sectnum, short hitag)
|
||||
{
|
||||
int i;
|
||||
SPRITEp sp;
|
||||
|
||||
if (sectnum < 0 || !TEST(sector[sectnum].extra, SECTFX_Z_ADJUST))
|
||||
return 0L;
|
||||
|
||||
StatIterator it(STAT_ST1);
|
||||
while ((i = it.NextIndex()) >= 0)
|
||||
SWStatIterator it(STAT_ST1);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
sp = &sprite[i];
|
||||
sp = &itActor->s();
|
||||
|
||||
if (sp->hitag == hitag && sp->sectnum == sectnum)
|
||||
{
|
||||
|
|
|
@ -286,7 +286,6 @@ int DoRotator(DSWActor* actor)
|
|||
ROTATORp r;
|
||||
short ndx,w,startwall,endwall;
|
||||
SPRITEp pivot = nullptr;
|
||||
int i;
|
||||
vec2_t nxy;
|
||||
int dist,closest;
|
||||
bool kill = false;
|
||||
|
@ -364,16 +363,17 @@ int DoRotator(DSWActor* actor)
|
|||
}
|
||||
|
||||
closest = 99999;
|
||||
StatIterator it(STAT_ROTATOR_PIVOT);
|
||||
while ((i = it.NextIndex()) >= 0)
|
||||
SWStatIterator it(STAT_ROTATOR_PIVOT);
|
||||
while (auto itActor = it.Next())
|
||||
{
|
||||
if (sprite[i].lotag == sp->lotag)
|
||||
auto itsp = &itActor->s();
|
||||
if (itsp->lotag == sp->lotag)
|
||||
{
|
||||
dist = Distance(sp->x, sp->y, sprite[i].x, sprite[i].y);
|
||||
dist = Distance(sp->x, sp->y, itsp->x, itsp->y);
|
||||
if (dist < closest)
|
||||
{
|
||||
closest = dist;
|
||||
pivot = &sprite[i];
|
||||
pivot = itsp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue