From 1ddcc41ed8dabb0d15f6d178ba60aa393cd26526 Mon Sep 17 00:00:00 2001 From: sirlemonhead Date: Thu, 9 Jan 2020 19:13:09 +0000 Subject: [PATCH] PCExhumed: Fix spark effect when destroying an energy tower. --- source/exhumed/src/object.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index 1b862faff..0af6271b6 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -1568,22 +1568,23 @@ void DoFinale() int BuildEnergyBlock(short nSector) { short startwall = sector[nSector].wallptr; + short nWalls = sector[nSector].wallnum; int x = 0; int y = 0; - for (int i = 0; i < sector[nSector].wallnum; i++) + for (int i = 0; i < nWalls; i++) { x += wall[startwall + i].x; y += wall[startwall + i].y; - // wall[startwall + i].picnum = kTile3621; + wall[startwall + i].picnum = kTile3621; wall[startwall + i].pal = 0; wall[startwall + i].shade = 50; } - int xAvg = x / 2; - int yAvg = y / 2; + int xAvg = x / nWalls; + int yAvg = y / nWalls; int nSprite = insertsprite(nSector, 406);