From fe23b05aa22d3164d6f6388436258d67df7cf3f9 Mon Sep 17 00:00:00 2001 From: Emil Laine Date: Sat, 23 Apr 2016 04:05:17 +0300 Subject: [PATCH] Fix ASSERT() That would never trigger the ASSERT. Now they always do. Conflicts: Sources/EntitiesMP/Summoner.es --- Sources/Engine/Base/Assert.h | 2 +- Sources/EntitiesMP/Common/Particles.cpp | 2 +- Sources/EntitiesMP/Grunt.es | 2 +- Sources/EntitiesMP/GruntSka.es | 2 +- Sources/EntitiesMP/PlayerWeapons.es | 2 +- Sources/EntitiesMP/Summoner.es | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Engine/Base/Assert.h b/Sources/Engine/Base/Assert.h index 80f4aa34c..c1b45de77 100644 --- a/Sources/Engine/Base/Assert.h +++ b/Sources/Engine/Base/Assert.h @@ -83,7 +83,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define BREAKPOINT \ if (1) { \ SAFEBREAKPOINT; \ - _assert("hard-coded breakpoint (CroTeam)",__FILE__,__LINE__); \ + _assert(false && "hard-coded breakpoint (CroTeam)",__FILE__,__LINE__); \ } else NOTHING /* CT DEBUG macro -- the expression is executed only in debug version */ diff --git a/Sources/EntitiesMP/Common/Particles.cpp b/Sources/EntitiesMP/Common/Particles.cpp index c369d050f..73980c128 100755 --- a/Sources/EntitiesMP/Common/Particles.cpp +++ b/Sources/EntitiesMP/Common/Particles.cpp @@ -527,7 +527,7 @@ void Particles_ViewerLocal(CEntity *penView) break; default: - ASSERT("Unknown environment particle type!"); + ASSERT(false && "Unknown environment particle type!"); break; } // for those EPHs that are not rendered, clear possible diff --git a/Sources/EntitiesMP/Grunt.es b/Sources/EntitiesMP/Grunt.es index 5a7c84ed3..e2acee1f1 100644 --- a/Sources/EntitiesMP/Grunt.es +++ b/Sources/EntitiesMP/Grunt.es @@ -99,7 +99,7 @@ functions: } else if (m_gtType==GT_COMMANDER) { return &eiGruntSoldier; } else { - ASSERT("Unknown grunt type!"); + ASSERT(false && "Unknown grunt type!"); return NULL; } }; diff --git a/Sources/EntitiesMP/GruntSka.es b/Sources/EntitiesMP/GruntSka.es index 880cafd6f..021ff35b3 100644 --- a/Sources/EntitiesMP/GruntSka.es +++ b/Sources/EntitiesMP/GruntSka.es @@ -280,7 +280,7 @@ functions: } else if (m_gtType==GT_COMMANDER) { return &eiGruntSoldier; } else { - ASSERT("Unknown grunt type!"); + ASSERT(false && "Unknown grunt type!"); return NULL; } }; diff --git a/Sources/EntitiesMP/PlayerWeapons.es b/Sources/EntitiesMP/PlayerWeapons.es index d98a9dee4..49693d2a6 100755 --- a/Sources/EntitiesMP/PlayerWeapons.es +++ b/Sources/EntitiesMP/PlayerWeapons.es @@ -3442,7 +3442,7 @@ functions: return (WeaponType)i; } } - ASSERT("Non-existant weapon in remap array!"); + ASSERT(false && "Non-existant weapon in remap array!"); return (WeaponType)0; } diff --git a/Sources/EntitiesMP/Summoner.es b/Sources/EntitiesMP/Summoner.es index 1c5469c65..22e61818d 100755 --- a/Sources/EntitiesMP/Summoner.es +++ b/Sources/EntitiesMP/Summoner.es @@ -618,7 +618,7 @@ functions: pen = &m_penGroup03Template01; iCount = IRnd()%m_iGroup03Count+1; } else { - ASSERT("Invalid group!"); + ASSERT(false && "Invalid group!"); iCount = 0; // DG: this should have a deterministic value in case this happens after all! } ASSERT(iCount>0);