- floatified position in BuildEnergyBlock

This commit is contained in:
Christoph Oelckers 2022-08-29 19:40:20 +02:00
parent 0fcbe57111
commit 7ddfd944e6

View file

@ -1554,25 +1554,20 @@ void DoFinale()
DExhumedActor* BuildEnergyBlock(sectortype* pSector)
{
int x = 0;
int y = 0;
DVector2 apos(0, 0);
for(auto& wal : wallsofsector(pSector))
{
x += wal.wall_int_pos().X;
y += wal.wall_int_pos().Y;
apos += wal.pos;
wal.picnum = kClockSymbol16;
wal.pal = 0;
wal.shade = 50;
}
int xAvg = x / pSector->wallnum;
int yAvg = y / pSector->wallnum;
auto pActor = insertActor(pSector, 406);
pActor->set_int_xy(xAvg, yAvg);
pActor->spr.pos.XY() = apos / pSector->wallnum;
pSector->extra = (int16_t)EnergyBlocks.Push(pActor);