- movestandables.

This commit is contained in:
Christoph Oelckers 2020-10-22 19:51:42 +02:00
parent 1af39eb29d
commit a3860de440
2 changed files with 48 additions and 52 deletions

View file

@ -1428,102 +1428,100 @@ CLEAR_THE_BOLT:
void movestandables_d(void) void movestandables_d(void)
{ {
StatIterator it(STAT_STANDABLE); DukeStatIterator it(STAT_STANDABLE);
int i; while (auto act = it.Next())
while ((i = it.NextIndex()) >= 0)
{ {
auto s = &sprite[i]; int picnum = act->s.picnum;
int picnum = s->picnum;
if (s->sectnum < 0) if (act->s.sectnum < 0)
{ {
deletesprite(i); deletesprite(act);
continue; continue;
} }
hittype[i].bposx = s->x; act->bposx = act->s.x;
hittype[i].bposy = s->y; act->bposy = act->s.y;
hittype[i].bposz = s->z; act->bposz = act->s.z;
if (picnum >= CRANE && picnum <= CRANE +3) if (picnum >= CRANE && picnum <= CRANE +3)
{ {
movecrane(&hittype[i], CRANE); movecrane(act, CRANE);
} }
else if (picnum >= WATERFOUNTAIN && picnum <= WATERFOUNTAIN + 3) else if (picnum >= WATERFOUNTAIN && picnum <= WATERFOUNTAIN + 3)
{ {
movefountain(&hittype[i], WATERFOUNTAIN); movefountain(act, WATERFOUNTAIN);
} }
else if (AFLAMABLE(picnum)) else if (AFLAMABLE(picnum))
{ {
moveflammable(&hittype[i], TIRE, BOX, BLOODPOOL); moveflammable(act, TIRE, BOX, BLOODPOOL);
} }
else if (picnum == TRIPBOMB) else if (picnum == TRIPBOMB)
{ {
movetripbomb(&hittype[i]); movetripbomb(act);
} }
else if (picnum >= CRACK1 && picnum <= CRACK1 + 3) else if (picnum >= CRACK1 && picnum <= CRACK1 + 3)
{ {
movecrack(&hittype[i]); movecrack(act);
} }
else if (picnum == FIREEXT) else if (picnum == FIREEXT)
{ {
movefireext(&hittype[i]); movefireext(act);
} }
else if (picnum == OOZFILTER || picnum == SEENINE || picnum == SEENINEDEAD || picnum == (SEENINEDEAD + 1)) else if (picnum == OOZFILTER || picnum == SEENINE || picnum == SEENINEDEAD || picnum == (SEENINEDEAD + 1))
{ {
moveooz(&hittype[i], SEENINE, SEENINEDEAD, OOZFILTER, EXPLOSION2); moveooz(act, SEENINE, SEENINEDEAD, OOZFILTER, EXPLOSION2);
} }
else if (picnum == MASTERSWITCH) else if (picnum == MASTERSWITCH)
{ {
movemasterswitch(&hittype[i], SEENINE, OOZFILTER); movemasterswitch(act, SEENINE, OOZFILTER);
} }
else if (picnum == VIEWSCREEN || picnum == VIEWSCREEN2) else if (picnum == VIEWSCREEN || picnum == VIEWSCREEN2)
{ {
moveviewscreen(&hittype[i]); moveviewscreen(act);
} }
else if (picnum == TRASH) else if (picnum == TRASH)
{ {
movetrash(&hittype[i]); movetrash(act);
} }
else if (picnum >= SIDEBOLT1 && picnum <= SIDEBOLT1 + 3) else if (picnum >= SIDEBOLT1 && picnum <= SIDEBOLT1 + 3)
{ {
movesidebolt(&hittype[i]); movesidebolt(act);
} }
else if (picnum >= BOLT1 && picnum <= BOLT1 + 3) else if (picnum >= BOLT1 && picnum <= BOLT1 + 3)
{ {
movebolt(&hittype[i]); movebolt(act);
} }
else if (picnum == WATERDRIP) else if (picnum == WATERDRIP)
{ {
movewaterdrip(&hittype[i], WATERDRIP); movewaterdrip(act, WATERDRIP);
} }
else if (picnum == DOORSHOCK) else if (picnum == DOORSHOCK)
{ {
movedoorshock(&hittype[i]); movedoorshock(act);
} }
else if (picnum == TOUCHPLATE) else if (picnum == TOUCHPLATE)
{ {
movetouchplate(&hittype[i], TOUCHPLATE); movetouchplate(act, TOUCHPLATE);
} }
else if (isIn(picnum, CANWITHSOMETHING, CANWITHSOMETHING2, CANWITHSOMETHING3, CANWITHSOMETHING4)) else if (isIn(picnum, CANWITHSOMETHING, CANWITHSOMETHING2, CANWITHSOMETHING3, CANWITHSOMETHING4))
{ {
movecanwithsomething(&hittype[i]); movecanwithsomething(act);
} }
else if (isIn(picnum, else if (isIn(picnum,
@ -1543,8 +1541,8 @@ void movestandables_d(void)
WATERBUBBLEMAKER)) WATERBUBBLEMAKER))
{ {
int x; int x;
int p = findplayer(s, &x); int p = findplayer(&act->s, &x);
execute(i, p, x); execute(act, p, x);
} }
} }
} }

View file

@ -999,83 +999,81 @@ CLEAR_THE_BOLT:
void movestandables_r(void) void movestandables_r(void)
{ {
StatIterator it(STAT_STANDABLE); DukeStatIterator it(STAT_STANDABLE);
int i; while (auto act = it.Next())
while ((i = it.NextIndex()) >= 0)
{ {
auto s = &sprite[i]; int picnum = act->s.picnum;
int picnum = s->picnum;
if (s->sectnum < 0) if (act->s.sectnum < 0)
{ {
deletesprite(i); deletesprite(act);
continue; continue;
} }
hittype[i].bposx = s->x; act->bposx = act->s.x;
hittype[i].bposy = s->y; act->bposy = act->s.y;
hittype[i].bposz = s->z; act->bposz = act->s.z;
if (picnum >= CRANE && picnum <= CRANE +3) if (picnum >= CRANE && picnum <= CRANE +3)
{ {
movecrane(&hittype[i], CRANE); movecrane(act, CRANE);
} }
else if (picnum >= WATERFOUNTAIN && picnum <= WATERFOUNTAIN + 3) else if (picnum >= WATERFOUNTAIN && picnum <= WATERFOUNTAIN + 3)
{ {
movefountain(&hittype[i], WATERFOUNTAIN); movefountain(act, WATERFOUNTAIN);
} }
else if (AFLAMABLE(picnum)) else if (AFLAMABLE(picnum))
{ {
moveflammable(&hittype[i], TIRE, BOX, BLOODPOOL); moveflammable(act, TIRE, BOX, BLOODPOOL);
} }
else if (picnum >= CRACK1 && picnum <= CRACK1 + 3) else if (picnum >= CRACK1 && picnum <= CRACK1 + 3)
{ {
movecrack(&hittype[i]); movecrack(act);
} }
else if (picnum == OOZFILTER || picnum == SEENINE || picnum == SEENINEDEAD || picnum == (SEENINEDEAD + 1)) else if (picnum == OOZFILTER || picnum == SEENINE || picnum == SEENINEDEAD || picnum == (SEENINEDEAD + 1))
{ {
moveooz(&hittype[i], SEENINE, SEENINEDEAD, OOZFILTER, EXPLOSION2); moveooz(act, SEENINE, SEENINEDEAD, OOZFILTER, EXPLOSION2);
} }
else if (picnum == MASTERSWITCH) else if (picnum == MASTERSWITCH)
{ {
movemasterswitch(&hittype[i], SEENINE, OOZFILTER); movemasterswitch(act, SEENINE, OOZFILTER);
} }
else if (picnum == TRASH) else if (picnum == TRASH)
{ {
movetrash(&hittype[i]); movetrash(act);
} }
else if (picnum >= BOLT1 && picnum <= BOLT1 + 3) else if (picnum >= BOLT1 && picnum <= BOLT1 + 3)
{ {
movebolt(&hittype[i]); movebolt(act);
} }
else if (picnum == WATERDRIP) else if (picnum == WATERDRIP)
{ {
movewaterdrip(&hittype[i], WATERDRIP); movewaterdrip(act, WATERDRIP);
} }
else if (picnum == DOORSHOCK) else if (picnum == DOORSHOCK)
{ {
movedoorshock(&hittype[i]); movedoorshock(act);
} }
else if (picnum == TOUCHPLATE) else if (picnum == TOUCHPLATE)
{ {
movetouchplate(&hittype[i], TOUCHPLATE); movetouchplate(act, TOUCHPLATE);
} }
else if (picnum == CANWITHSOMETHING) else if (picnum == CANWITHSOMETHING)
{ {
movecanwithsomething(&hittype[i]); movecanwithsomething(act);
} }
else if (isIn(picnum, else if (isIn(picnum,
@ -1093,8 +1091,8 @@ void movestandables_r(void)
CEILINGSTEAM)) CEILINGSTEAM))
{ {
int x; int x;
int p = findplayer(s, &x); int p = findplayer(&act->s, &x);
execute(i, p, x); execute(act, p, x);
} }
} }
} }