Skip to content

Commit 07675e2

Browse files
Fixed assertions in non-debug environment (#1082)
Co-authored-by: Alex Lo <xycaleth@gmail.com>
1 parent 04dc594 commit 07675e2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

code/game/bg_pmove.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10565,8 +10565,9 @@ qboolean PM_SaberLocked( void )
1056510565
#endif
1056610566
gi.G2API_GetBoneAnimIndex( &gent->ghoul2[gent->playerModel], gent->lowerLumbarBone,
1056710567
(cg.time?cg.time:level.time), &currentFrame, &junk, &junk, &junk, &junk2, NULL );
10568+
#ifdef _DEBUG
1056810569
assert( ret ); // this would be pretty bad, the below code seems to assume the call succeeds. -gil
10569-
10570+
#endif
1057010571
strength = G_SaberLockStrength( gent );
1057110572
if ( PM_InSaberLockOld( pm->ps->torsoAnim ) )
1057210573
{//old locks

code/rd-vanilla/G2_API.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,9 @@ void RestoreGhoul2InfoArray()
730730
#endif // _DEBUG
731731
singleton->Deserialize ((const char *)data, size);
732732
R_Free ((void *)data);
733-
733+
#ifdef _DEBUG
734734
assert (read == size);
735+
#endif
735736
}
736737
}
737738

@@ -743,9 +744,9 @@ void SaveGhoul2InfoArray()
743744
size_t written =
744745
#endif // _DEBUG
745746
singleton->Serialize ((char *)data);
746-
747+
#ifdef _DEBUG
747748
assert (written == size);
748-
749+
#endif // _DEBUG
749750
if ( !ri.PD_Store (PERSISTENT_G2DATA, data, size) )
750751
{
751752
Com_Printf (S_COLOR_RED "ERROR: Failed to store persistent renderer data.\n");

codemp/rd-vanilla/G2_API.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,9 @@ void RestoreGhoul2InfoArray()
668668
#endif
669669
singleton->Deserialize ((const char *)data, size);
670670
Z_Free ((void *)data);
671-
671+
#ifdef _DEBUG
672672
assert (read == size);
673+
#endif
673674
}
674675
}
675676

@@ -681,9 +682,9 @@ void SaveGhoul2InfoArray()
681682
size_t written =
682683
#endif
683684
singleton->Serialize ((char *)data);
684-
685+
#ifdef _DEBUG
685686
assert (written == size);
686-
687+
#endif
687688
if ( !ri.PD_Store (PERSISTENT_G2DATA, data, size) )
688689
{
689690
Com_Printf (S_COLOR_RED "ERROR: Failed to store persistent renderer data.\n");

0 commit comments

Comments
 (0)