Skip to content

Commit

Permalink
Better & correct fix than 8cd254d
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Mar 18, 2024
1 parent a5f90f8 commit 06a2622
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rts/Rendering/Env/Decals/GroundDecalHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,15 +1466,13 @@ void CGroundDecalHandler::GhostCreated(const CSolidObject* object, const GhostSo


void CGroundDecalHandler::ExplosionOccurred(const CExplosionParams& event) {
if (!event.weaponDef)
if ((event.weaponDef != nullptr) && !event.weaponDef->visuals.explosionScar)
return;

if (!event.weaponDef->visuals.explosionScar)
return;

const auto decalDir = event.weaponDef->visuals.scarProjVector.w == 0.0f ?
CGround::GetNormal(event.pos.x, event.pos.z, false) :
float3{ event.weaponDef->visuals.scarProjVector };
const bool hasForcedProjVec = (event.weaponDef != nullptr && event.weaponDef->visuals.scarProjVector.w != 0.0f);
const auto decalDir = hasForcedProjVec ?
float3{ event.weaponDef->visuals.scarProjVector } :
CGround::GetNormal(event.pos.x, event.pos.z, false);

AddExplosion(std::move(AddExplosionInfo{
event.pos,
Expand Down

0 comments on commit 06a2622

Please sign in to comment.