Skip to content

Commit

Permalink
Fixed assertions in non-debug environment (JACoders#1082)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Lo <[email protected]>
  • Loading branch information
KiralyCraft and xycaleth authored May 16, 2021
1 parent 04dc594 commit 07675e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion code/game/bg_pmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10565,8 +10565,9 @@ qboolean PM_SaberLocked( void )
#endif
gi.G2API_GetBoneAnimIndex( &gent->ghoul2[gent->playerModel], gent->lowerLumbarBone,
(cg.time?cg.time:level.time), &currentFrame, &junk, &junk, &junk, &junk2, NULL );
#ifdef _DEBUG
assert( ret ); // this would be pretty bad, the below code seems to assume the call succeeds. -gil

#endif
strength = G_SaberLockStrength( gent );
if ( PM_InSaberLockOld( pm->ps->torsoAnim ) )
{//old locks
Expand Down
7 changes: 4 additions & 3 deletions code/rd-vanilla/G2_API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,9 @@ void RestoreGhoul2InfoArray()
#endif // _DEBUG
singleton->Deserialize ((const char *)data, size);
R_Free ((void *)data);

#ifdef _DEBUG
assert (read == size);
#endif
}
}

Expand All @@ -743,9 +744,9 @@ void SaveGhoul2InfoArray()
size_t written =
#endif // _DEBUG
singleton->Serialize ((char *)data);

#ifdef _DEBUG
assert (written == size);

#endif // _DEBUG
if ( !ri.PD_Store (PERSISTENT_G2DATA, data, size) )
{
Com_Printf (S_COLOR_RED "ERROR: Failed to store persistent renderer data.\n");
Expand Down
7 changes: 4 additions & 3 deletions codemp/rd-vanilla/G2_API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,9 @@ void RestoreGhoul2InfoArray()
#endif
singleton->Deserialize ((const char *)data, size);
Z_Free ((void *)data);

#ifdef _DEBUG
assert (read == size);
#endif
}
}

Expand All @@ -681,9 +682,9 @@ void SaveGhoul2InfoArray()
size_t written =
#endif
singleton->Serialize ((char *)data);

#ifdef _DEBUG
assert (written == size);

#endif
if ( !ri.PD_Store (PERSISTENT_G2DATA, data, size) )
{
Com_Printf (S_COLOR_RED "ERROR: Failed to store persistent renderer data.\n");
Expand Down

0 comments on commit 07675e2

Please sign in to comment.