Skip to content

Commit

Permalink
Merge pull request #305 from sprunk/patch-35
Browse files Browse the repository at this point in the history
Expand CEG underground lenience (1 → 20 elmo)
  • Loading branch information
rtri committed Mar 25, 2017
2 parents bb237d9 + e0949e9 commit d8c2cab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rts/Sim/Projectiles/ExplosionGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ unsigned int CCustomExplosionGenerator::GetFlagsFromHeight(float height, float g
const float waterDist = math::fabsf(height);
const float altitude = height - groundHeight;

const float groundLenience = 20.0f;
// note: ranges do not overlap, although code in
// *ExplosionGenerator::Explosion assumes they can
if (altitude < -1.0f) {
if (altitude < -groundLenience) {
/* underground! don't spawn CEG! */
} else
if (height >= 5.0f) { // above water
if (altitude >= 20.0f) {
if (altitude >= groundLenience) {
flags |= CCustomExplosionGenerator::SPW_AIR; // air
} else {
flags |= CCustomExplosionGenerator::SPW_GROUND; // ground
Expand Down

0 comments on commit d8c2cab

Please sign in to comment.