Skip to content

Commit

Permalink
Prevent structure turret stretching again
Browse files Browse the repository at this point in the history
Stops structure turrets from stretching to their foundation as described in ticket 4537.
  • Loading branch information
KJeff01 committed Feb 10, 2017
1 parent 0ec7ac7 commit f79286d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/display3d.cpp
Expand Up @@ -2193,11 +2193,6 @@ void renderStructure(STRUCTURE *psStructure, const glm::mat4 &viewMatrix)
pieFlagData = 0;
}

if (defensive && !structureIsBlueprint(psStructure) && !(strImd->flags & iV_IMD_NOSTRETCH))
{
pie_SetShaderStretchDepth(psStructure->pos.z - psStructure->foundationDepth);
}

// check for animation model replacement - if none found, use animation in existing IMD
if (strImd->objanimpie[psStructure->animationEvent])
{
Expand All @@ -2206,7 +2201,12 @@ void renderStructure(STRUCTURE *psStructure, const glm::mat4 &viewMatrix)

while (strImd)
{
if (defensive && !structureIsBlueprint(psStructure) && !(strImd->flags & iV_IMD_NOSTRETCH))
{
pie_SetShaderStretchDepth(psStructure->pos.z - psStructure->foundationDepth);
}
drawShape(psStructure, strImd, colour, buildingBrightness, pieFlag, pieFlagData, viewMatrix * modelMatrix);
pie_SetShaderStretchDepth(0);
if (psStructure->sDisplay.imd->nconnectors > 0)
{
renderStructureTurrets(psStructure, strImd, buildingBrightness, pieFlag, pieFlagData, ecmFlag, viewMatrix * modelMatrix);
Expand Down

0 comments on commit f79286d

Please sign in to comment.