PCExhumed: Fix spark effect when destroying an energy tower.

This commit is contained in:
sirlemonhead 2020-01-09 19:13:09 +00:00 committed by Christoph Oelckers
parent 74fdb6dbcb
commit 1ddcc41ed8

View file

@ -1568,22 +1568,23 @@ void DoFinale()
int BuildEnergyBlock(short nSector) int BuildEnergyBlock(short nSector)
{ {
short startwall = sector[nSector].wallptr; short startwall = sector[nSector].wallptr;
short nWalls = sector[nSector].wallnum;
int x = 0; int x = 0;
int y = 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; x += wall[startwall + i].x;
y += wall[startwall + i].y; y += wall[startwall + i].y;
// wall[startwall + i].picnum = kTile3621; wall[startwall + i].picnum = kTile3621;
wall[startwall + i].pal = 0; wall[startwall + i].pal = 0;
wall[startwall + i].shade = 50; wall[startwall + i].shade = 50;
} }
int xAvg = x / 2; int xAvg = x / nWalls;
int yAvg = y / 2; int yAvg = y / nWalls;
int nSprite = insertsprite(nSector, 406); int nSprite = insertsprite(nSector, 406);