From 7ddfd944e6898dd3fcd5dd418d910a2ac9556524 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Aug 2022 19:40:20 +0200 Subject: [PATCH] - floatified position in BuildEnergyBlock --- source/games/exhumed/src/object.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 2a27b53e2..78c6b7039 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -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);