by Graf Zahl » Sat May 21, 2005 9:17 am
As a workaround you can just create a second lava animation which uses X_002 as its base picture and use a standard bitmask damage type for the sector. You don't even need to duplicate any graphics for that.
As for the cause of the bug:
The damage for these sectors is incorrectly applied in both P_PlayerInSpecialSector and P_PlayerOnSpecialFlat. The on in P_PlayerInSpecialSector is not only unnecessary, worse, it contains a bug which causes it to do damage every time the function is called. But it is only called when there is a sector special so it doesn't happen when the sector is 'normal'.
THe following piece of code has to be removed from P_PlayerInSpecialSector:
Code: Select all
int terrainnum = TerrainTypes[sector->floorpic];
if (Terrains[terrainnum].DamageAmount &&
(level.time & Terrains[terrainnum].DamageTimeMask))
{
P_DamageMobj (player->mo, NULL, NULL, Terrains[terrainnum].DamageAmount,
Terrains[terrainnum].DamageMOD);
}
As a workaround you can just create a second lava animation which uses X_002 as its base picture and use a standard bitmask damage type for the sector. You don't even need to duplicate any graphics for that.
As for the cause of the bug:
The damage for these sectors is incorrectly applied in both P_PlayerInSpecialSector and P_PlayerOnSpecialFlat. The on in P_PlayerInSpecialSector is not only unnecessary, worse, it contains a bug which causes it to do damage every time the function is called. But it is only called when there is a sector special so it doesn't happen when the sector is 'normal'.
THe following piece of code has to be removed from P_PlayerInSpecialSector:
[code]
int terrainnum = TerrainTypes[sector->floorpic];
if (Terrains[terrainnum].DamageAmount &&
(level.time & Terrains[terrainnum].DamageTimeMask))
{
P_DamageMobj (player->mo, NULL, NULL, Terrains[terrainnum].DamageAmount,
Terrains[terrainnum].DamageMOD);
}
[/code]