Skip to content

Commit b49e03a

Browse files
drug007eagleivg
authored andcommitted
add asserts
1 parent 2a21afc commit b49e03a

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ void CRender::OnFrame()
452452
if (ps_r2_ls_flags.test(R2FLAG_EXP_MT_CALC))
453453
{
454454
// MT-details (@front)
455+
assert (Details);
455456
Device.seqParallel.insert(Device.seqParallel.begin(),
456457
fastdelegate::FastDelegate0<>(Details, &CDetailManager::MT_CALC));
457458

src/xrCore/fastdelegate.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#endif // _MSC_VER > 1000
5353

5454
#include <memory.h> // to allow <,> comparisons
55+
#include <cassert>
5556

5657
//////////////////////////////////////////////////
5758
#define xr_stdcall __stdcall
@@ -969,7 +970,11 @@ class FastDelegate0
969970
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction, function_to_bind);
970971
}
971972
// Invoke the delegate
972-
RetType operator()() const { return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); }
973+
RetType operator()() const {
974+
assert (m_Closure.GetClosureThis());
975+
assert (m_Closure.GetClosureMemPtr());
976+
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))();
977+
}
973978
// Implicit conversion to "bool" using the safe_bool idiom
974979
private:
975980
typedef struct SafeBoolStruct

src/xrGame/Level.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,10 @@ void CLevel::OnFrame()
440440
if (!GEnv.isDedicatedServer)
441441
{
442442
if (g_mt_config.test(mtMap))
443+
{
444+
assert(m_map_manager);
443445
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(m_map_manager, &CMapManager::Update));
446+
}
444447
else
445448
MapManager().Update();
446449
if (IsGameTypeSingle() && Device.dwPrecacheFrame == 0)
@@ -549,6 +552,7 @@ void CLevel::OnFrame()
549552
{
550553
if (g_mt_config.test(mtLevelSounds))
551554
{
555+
assert(m_level_sound_manager);
552556
Device.seqParallel.push_back(
553557
fastdelegate::FastDelegate0<>(m_level_sound_manager, &CLevelSoundManager::Update));
554558
}

src/xrGame/ui/UIPdaWnd.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ void CUIPdaWnd::Update()
165165
m_clock->TextItemControl().SetText(
166166
InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes).c_str());
167167

168+
assert(pUILogsWnd);
168169
Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(pUILogsWnd, &CUILogsWnd::PerformWork));
169170
}
170171

0 commit comments

Comments
 (0)