- dumped broken and useless xyrand function.

Didn't work, wasn't used anywhere else, so a properly done local inline is preferable.
This commit is contained in:
Christoph Oelckers 2022-10-06 20:44:52 +02:00
parent 32e1f07b60
commit 89816f4582
2 changed files with 5 additions and 9 deletions

View file

@ -5230,15 +5230,16 @@ void movefta(void)
{
if (badguy(act))
{
double px = ps[p].opos.X - xyrand(64);
double py = ps[p].opos.Y - xyrand(64);
auto xyrand = []() -> double { return (64 - (krand() & 127)) * maptoworld; };
double px = ps[p].opos.X - xyrand();
double py = ps[p].opos.Y - xyrand();
updatesector(DVector3(px, py, 0), &psect);
if (psect == nullptr)
{
continue;
}
double sx = act->spr.pos.X - xyrand(64);
double sy = act->spr.pos.Y - xyrand(64);
double sx = act->spr.pos.X - xyrand();
double sy = act->spr.pos.Y - xyrand();
// The second updatesector call here used px and py again and was redundant as coded.
// SFLAG_MOVEFTA_CHECKSEE is set for all actors in Duke.

View file

@ -251,9 +251,4 @@ inline double zrand(int spread)
return r * zmaptoworld;
}
inline double xyrand(int mask)
{
return ((krand() % mask) - (mask << 1) - 1) * maptoworld;
}
END_DUKE_NS