Skip to content

Commit 0ecf60c

Browse files
committed
Clip.cpp TestHugeTranslation(): Disable annoying assertion
and turn the prints into warnings moved the commented out assertions to where they were before commit c22965b so the code is a bit closer to the original (and the SDK)
1 parent 7415700 commit 0ecf60c

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

neo/d3xp/physics/Clip.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -965,26 +965,27 @@ idClip::TestHugeTranslation
965965
*/
966966
ID_INLINE bool TestHugeTranslation( trace_t &results, const idClipModel *mdl, const idVec3 &start, const idVec3 &end, const idMat3 &trmAxis ) {
967967
if ( mdl != NULL && ( end - start ).LengthSqr() > Square( CM_MAX_TRACE_DIST ) ) {
968+
#ifndef CTF
969+
// May be important: This occurs in CTF when a player connects and spawns
970+
// in the PVS of a player that has a flag that is spawning the idMoveableItem
971+
// "nuggets". The error seems benign and the assert was getting in the way
972+
// of testing.
973+
// assert( 0 ); DG: this was annoying and not really necessary, a Warning should suffice.
974+
#endif
975+
968976
results.fraction = 0.0f;
969977
results.endpos = start;
970978
results.endAxis = trmAxis;
971979
memset( &results.c, 0, sizeof( results.c ) );
972980
results.c.point = start;
973981

974982
if ( mdl->GetEntity() ) {
975-
gameLocal.Printf( "huge translation for clip model %d on entity %d '%s'\n", mdl->GetId(), mdl->GetEntity()->entityNumber, mdl->GetEntity()->GetName() );
983+
gameLocal.Warning( "huge translation for clip model %d on entity %d '%s'\n", mdl->GetId(), mdl->GetEntity()->entityNumber, mdl->GetEntity()->GetName() );
976984
} else {
977-
gameLocal.Printf( "huge translation for clip model %d\n", mdl->GetId() );
985+
gameLocal.Warning( "huge translation for clip model %d\n", mdl->GetId() );
978986
}
979-
gameLocal.Printf( " from (%.2f %.2f %.2f) to (%.2f %.2f %.2f)\n", start.x, start.y, start.z, end.x, end.y, end.z);
987+
gameLocal.Warning( " from (%.2f %.2f %.2f) to (%.2f %.2f %.2f)\n", start.x, start.y, start.z, end.x, end.y, end.z);
980988

981-
#ifndef CTF
982-
// May be important: This occurs in CTF when a player connects and spawns
983-
// in the PVS of a player that has a flag that is spawning the idMoveableItem
984-
// "nuggets". The error seems benign and the assert was getting in the way
985-
// of testing.
986-
assert( 0 );
987-
#endif
988989
return true;
989990
}
990991
return false;

neo/game/physics/Clip.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ idClip::TestHugeTranslation
965965
*/
966966
ID_INLINE bool TestHugeTranslation( trace_t &results, const idClipModel *mdl, const idVec3 &start, const idVec3 &end, const idMat3 &trmAxis ) {
967967
if ( mdl != NULL && ( end - start ).LengthSqr() > Square( CM_MAX_TRACE_DIST ) ) {
968-
968+
// assert( 0 ); DG: this was annoying and not really necessary, a Warning should suffice.
969969

970970
results.fraction = 0.0f;
971971
results.endpos = start;
@@ -975,22 +975,13 @@ ID_INLINE bool TestHugeTranslation( trace_t &results, const idClipModel *mdl, co
975975
results.c.entityNum = ENTITYNUM_WORLD;
976976

977977
if ( mdl->GetEntity() ) {
978-
gameLocal.Printf( "huge translation for clip model %d on entity %d '%s'\n", mdl->GetId(), mdl->GetEntity()->entityNumber, mdl->GetEntity()->GetName() );
978+
gameLocal.Warning( "huge translation for clip model %d on entity %d '%s'\n", mdl->GetId(), mdl->GetEntity()->entityNumber, mdl->GetEntity()->GetName() );
979979
} else {
980-
gameLocal.Printf( "huge translation for clip model %d\n", mdl->GetId() );
980+
gameLocal.Warning( "huge translation for clip model %d\n", mdl->GetId() );
981981
}
982982

983-
gameLocal.Printf( " from (%.2f %.2f %.2f) to (%.2f %.2f %.2f)\n", start.x, start.y, start.z, end.x, end.y, end.z);
984-
985-
if ( mdl->GetEntity() != NULL && idStr::Cmp(mdl->GetEntity()->GetName(), "monster_zsec_shotgun_12") == 0
986-
&& idStr::Cmp(gameLocal.GetMapName(), "maps/game/alphalabs4.map") == 0 )
987-
{
988-
// there is a map bug in alpha4 where the ride of death can push a monster far into the void
989-
// don't assert there
990-
return true;
991-
}
983+
gameLocal.Warning( " from (%.2f %.2f %.2f) to (%.2f %.2f %.2f)\n", start.x, start.y, start.z, end.x, end.y, end.z);
992984

993-
assert( 0 );
994985
return true;
995986
}
996987
return false;

0 commit comments

Comments
 (0)