diff --git a/src/cgame/cg_api.cpp b/src/cgame/cg_api.cpp index 78028667457..ec968136e71 100644 --- a/src/cgame/cg_api.cpp +++ b/src/cgame/cg_api.cpp @@ -143,12 +143,12 @@ void VM::VMHandleSyscall(uint32_t id, Util::Reader reader) { break; default: - Com_Error(errorParm_t::ERR_DROP, "VMMain(): unknown cgame command %i", minor); + Sys::Drop("VMMain(): unknown cgame command %i", minor); } } else if (major < VM::LAST_COMMON_SYSCALL) { VM::HandleCommonSyscall(major, minor, std::move(reader), VM::rootChannel); } else { - Com_Error(errorParm_t::ERR_DROP, "unhandled VM major syscall number %i", major); + Sys::Drop("unhandled VM major syscall number %i", major); } } diff --git a/src/cgame/cg_buildable.cpp b/src/cgame/cg_buildable.cpp index 480622b7b17..80ce78db19c 100644 --- a/src/cgame/cg_buildable.cpp +++ b/src/cgame/cg_buildable.cpp @@ -859,7 +859,7 @@ static void CG_SetBuildableLerpFrameAnimation( buildable_t buildable, lerpFrame_ if ( newAnimation < 0 || newAnimation >= MAX_BUILDABLE_ANIMATIONS ) { - Com_Error(errorParm_t::ERR_DROP, "Bad animation number: %i", newAnimation ); + Sys::Drop( "Bad animation number: %i", newAnimation ); } if ( cg_buildables[ buildable ].md5 ) diff --git a/src/cgame/cg_ents.cpp b/src/cgame/cg_ents.cpp index 2681c78f8f6..e483db4390f 100644 --- a/src/cgame/cg_ents.cpp +++ b/src/cgame/cg_ents.cpp @@ -942,7 +942,7 @@ static void CG_InterpolateEntityPosition( centity_t *cent ) // a snapshot ahead of the current one if ( cg.nextSnap == nullptr ) { - Com_Error(errorParm_t::ERR_DROP, "CG_InterpolateEntityPosition: cg.nextSnap == NULL" ); + Sys::Drop( "CG_InterpolateEntityPosition: cg.nextSnap == NULL" ); } f = cg.frameInterpolation; @@ -1196,7 +1196,7 @@ static void CG_AddCEntity( centity_t *cent ) switch ( cent->currentState.eType ) { default: - Com_Error(errorParm_t::ERR_DROP, "Bad entity type: %s", Util::enum_str(cent->currentState.eType)); + Sys::Drop("Bad entity type: %s", Util::enum_str(cent->currentState.eType)); case entityType_t::ET_INVISIBLE: case entityType_t::ET_PUSHER: diff --git a/src/cgame/cg_event.cpp b/src/cgame/cg_event.cpp index bade0a4599a..2db1d7ece41 100644 --- a/src/cgame/cg_event.cpp +++ b/src/cgame/cg_event.cpp @@ -126,7 +126,7 @@ static void CG_Obituary( entityState_t *ent ) if ( target < 0 || target >= MAX_CLIENTS ) { - Com_Error(errorParm_t::ERR_DROP, "CG_Obituary: target out of range" ); + Sys::Drop( "CG_Obituary: target out of range" ); } ci = &cgs.clientinfo[ target ]; @@ -1371,7 +1371,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; default: - Com_Error(errorParm_t::ERR_DROP, "Unknown event: %i", event ); + Sys::Drop("Unknown event: %i", event); } } diff --git a/src/cgame/cg_main.cpp b/src/cgame/cg_main.cpp index 80ba0c81a17..67fae140514 100644 --- a/src/cgame/cg_main.cpp +++ b/src/cgame/cg_main.cpp @@ -1210,7 +1210,7 @@ static void CG_RegisterGraphics() if ( cgs.numInlineModels > MAX_SUBMODELS ) { - Com_Error(errorParm_t::ERR_DROP, "MAX_SUBMODELS (%d) exceeded by %d", MAX_SUBMODELS, cgs.numInlineModels - MAX_SUBMODELS ); + Sys::Drop( "MAX_SUBMODELS (%d) exceeded by %d", MAX_SUBMODELS, cgs.numInlineModels - MAX_SUBMODELS ); } for ( i = 1; i < cgs.numInlineModels; i++ ) @@ -1397,7 +1397,7 @@ const char *CG_ConfigString( int index ) { if ( index < 0 || index >= MAX_CONFIGSTRINGS ) { - Com_Error(errorParm_t::ERR_DROP, "CG_ConfigString: bad index: %i", index ); + Sys::Drop( "CG_ConfigString: bad index: %i", index ); } return cgs.gameState[index].c_str(); @@ -1512,7 +1512,7 @@ void CG_Init( int serverMessageNum, int clientNum, glconfig_t gl, GameStateCSs g s = CG_ConfigString( CS_GAME_VERSION ); // if( strcmp( s, GAME_VERSION ) ) -// Com_Error(errorParm_t::ERR_DROP, "Client/Server game mismatch: %s/%s", GAME_VERSION, s ); +// Sys::Drop( "Client/Server game mismatch: %s/%s", GAME_VERSION, s ); s = CG_ConfigString( CS_LEVEL_START_TIME ); cgs.levelStartTime = atoi( s ); diff --git a/src/cgame/cg_marks.cpp b/src/cgame/cg_marks.cpp index 5f237b3b7bc..d4dc3ca5389 100644 --- a/src/cgame/cg_marks.cpp +++ b/src/cgame/cg_marks.cpp @@ -73,7 +73,7 @@ void CG_FreeMarkPoly( markPoly_t *le ) { if ( !le->prevMark ) { - Com_Error(errorParm_t::ERR_DROP, "CG_FreeMarkPoly: not active" ); + Sys::Drop( "CG_FreeMarkPoly: not active" ); } // remove from the doubly linked active list @@ -165,7 +165,7 @@ void CG_ImpactMark( qhandle_t markShader, const vec3_t origin, const vec3_t dir, if ( radius <= 0 ) { - Com_Error(errorParm_t::ERR_DROP, "CG_ImpactMark called with <= 0 radius" ); + Sys::Drop( "CG_ImpactMark called with <= 0 radius" ); } //if ( markTotal >= MAX_MARK_POLYS ) { diff --git a/src/cgame/cg_parseutils.cpp b/src/cgame/cg_parseutils.cpp index 44646ce1805..8e3d289ca71 100644 --- a/src/cgame/cg_parseutils.cpp +++ b/src/cgame/cg_parseutils.cpp @@ -362,7 +362,7 @@ static bool PC_Expression_Parse( int handle, float *f ) break; default: - Com_Error( errorParm_t::ERR_FATAL, "Unknown operator '%c' in postfix string", op ); + Sys::Error( "Unknown operator '%c' in postfix string", op ); } PUSH_VAL( stack, result ); diff --git a/src/cgame/cg_players.cpp b/src/cgame/cg_players.cpp index a4eb2ed49e6..e4d0d137afa 100644 --- a/src/cgame/cg_players.cpp +++ b/src/cgame/cg_players.cpp @@ -88,7 +88,7 @@ sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ) } } - Com_Error(errorParm_t::ERR_DROP, "Unknown custom sound: %s", soundName ); + Sys::Drop( "Unknown custom sound: %s", soundName ); return 0; } @@ -1255,7 +1255,7 @@ static void CG_LoadClientInfo( clientInfo_t *ci ) if ( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName ) ) { - Com_Error(errorParm_t::ERR_DROP, "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName ); + Sys::Drop( "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName ); } // sounds @@ -1609,7 +1609,7 @@ static void CG_SetLerpFrameAnimation( clientInfo_t *ci, lerpFrame_t *lf, int new if ( newAnimation < 0 || newAnimation >= MAX_PLAYER_TOTALANIMATIONS ) { - Com_Error(errorParm_t::ERR_DROP, "Bad animation number: %i", newAnimation ); + Sys::Drop( "Bad animation number: %i", newAnimation ); } anim = &ci->animations[ newAnimation ]; @@ -2024,7 +2024,7 @@ static void CG_PlayerAngles( centity_t *cent, const vec3_t srcAngles, if ( dir < 0 || dir > 7 ) { - Com_Error(errorParm_t::ERR_DROP, "Bad player movement angle" ); + Sys::Drop( "Bad player movement angle" ); } } @@ -2293,7 +2293,7 @@ static void CG_PlayerNonSegAxis( centity_t *cent, vec3_t srcAngles, vec3_t nonSe if ( dir < 0 || dir > 7 ) { - Com_Error(errorParm_t::ERR_DROP, "Bad player movement angle" ); + Sys::Drop( "Bad player movement angle" ); } } @@ -2364,7 +2364,7 @@ static void CG_JetpackAnimation( centity_t *cent, int *old, int *now, float *bac lf->animationNumber = cent->jetpackAnim; if( cent->jetpackAnim < 0 || cent->jetpackAnim >= MAX_JETPACK_ANIMATIONS ) - Com_Error(errorParm_t::ERR_DROP, "Bad animation number: %i", cent->jetpackAnim ); + Sys::Drop( "Bad animation number: %i", cent->jetpackAnim ); if( JETPACK_USES_SKELETAL_ANIMATION ) @@ -2944,7 +2944,7 @@ void CG_Player( centity_t *cent ) if ( clientNum < 0 || clientNum >= MAX_CLIENTS ) { - Com_Error(errorParm_t::ERR_DROP, "Bad clientNum on player entity" ); + Sys::Drop( "Bad clientNum on player entity" ); } ci = &cgs.clientinfo[ clientNum ]; @@ -3442,7 +3442,7 @@ void CG_Corpse( centity_t *cent ) if ( corpseNum < 0 || corpseNum >= MAX_CLIENTS ) { - Com_Error(errorParm_t::ERR_DROP, "Bad corpseNum on corpse entity: %d", corpseNum ); + Sys::Drop( "Bad corpseNum on corpse entity: %d", corpseNum ); } ci = &cgs.corpseinfo[ corpseNum ]; diff --git a/src/cgame/cg_rocket.cpp b/src/cgame/cg_rocket.cpp index c30771fe7e0..e8d3cafbdb3 100644 --- a/src/cgame/cg_rocket.cpp +++ b/src/cgame/cg_rocket.cpp @@ -116,7 +116,7 @@ void CG_Rocket_Init( glconfig_t gl ) // Only load stuff from ui/ if ( !trap_FS_LoadPak( rocket_pak.string, "ui/" ) ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load custom UI pak: %s.", rocket_pak.string ); + Sys::Drop( "Unable to load custom UI pak: %s.", rocket_pak.string ); } } @@ -125,13 +125,13 @@ void CG_Rocket_Init( glconfig_t gl ) if ( len <= 0 ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load %s. No rocket menus loaded.", rocket_menuFile.string ); + Sys::Drop( "Unable to load %s. No rocket menus loaded.", rocket_menuFile.string ); } if ( len >= (int) sizeof( text ) - 1 ) { trap_FS_FCloseFile( f ); - Com_Error(errorParm_t::ERR_DROP, "File %s too long.", rocket_menuFile.string ); + Sys::Drop( "File %s too long.", rocket_menuFile.string ); } trap_FS_Read( text, len, f ); @@ -179,7 +179,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( *token != '{' ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); + Sys::Drop( "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); } for ( i = 0; i < ROCKETMENU_NUM_TYPES; ++i ) @@ -188,7 +188,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Unexpected end of file. Expecting path to RML menu.", rocket_menuFile.string ); + Sys::Drop( "Error parsing %s. Unexpected end of file. Expecting path to RML menu.", rocket_menuFile.string ); } rocketInfo.menu[ i ].path = BG_strdup( token ); @@ -198,7 +198,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Unexpected end of file. Expecting RML document id.", rocket_menuFile.string ); + Sys::Drop( "Error parsing %s. Unexpected end of file. Expecting RML document id.", rocket_menuFile.string ); } rocketInfo.menu[ i ].id = BG_strdup( token ); @@ -208,7 +208,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( *token != '}' ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Expecting \"}\" but found \"%c\".", rocket_menuFile.string, *token ); + Sys::Drop( "Error parsing %s. Expecting \"}\" but found \"%c\".", rocket_menuFile.string, *token ); } while ( *token && *token != '}' ) @@ -217,7 +217,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Unexpected end of file. Expecting RML document.", rocket_menuFile.string ); + Sys::Drop( "Error parsing %s. Unexpected end of file. Expecting RML document.", rocket_menuFile.string ); } Rocket_LoadDocument( token ); @@ -232,7 +232,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( *token != '{' ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); + Sys::Drop( "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); } while ( 1 ) @@ -246,7 +246,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Unexpected end of file. Expecting closing '}'.", rocket_menuFile.string ); + Sys::Drop( "Error parsing %s. Unexpected end of file. Expecting closing '}'.", rocket_menuFile.string ); } // Skip non-RML files @@ -269,7 +269,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( *token != '{' ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); + Sys::Drop( "Error parsing %s. Expecting \"{\" but found \"%c\".", rocket_menuFile.string, *token ); } while ( 1 ) @@ -283,7 +283,7 @@ void CG_Rocket_Init( glconfig_t gl ) if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Error parsing %s. Unexpected end of file. Expecting closing '}'.", rocket_menuFile.string ); + Sys::Drop( "Error parsing %s. Unexpected end of file. Expecting closing '}'.", rocket_menuFile.string ); } Rocket_LoadFont( token ); @@ -319,13 +319,13 @@ void CG_Rocket_LoadHuds() if ( len <= 0 ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load %s. No rocket menus loaded.", rocket_menuFile.string ); + Sys::Drop( "Unable to load %s. No rocket menus loaded.", rocket_menuFile.string ); } if ( len >= (int) sizeof( text ) - 1 ) { trap_FS_FCloseFile( f ); - Com_Error(errorParm_t::ERR_DROP, "File %s too long.", rocket_hudFile.string ); + Sys::Drop( "File %s too long.", rocket_hudFile.string ); } trap_FS_Read( text, len, f ); @@ -359,7 +359,7 @@ void CG_Rocket_LoadHuds() if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off units.", rocket_hudFile.string ); + Sys::Drop( "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off units.", rocket_hudFile.string ); } if ( *token == '}' ) @@ -395,7 +395,7 @@ void CG_Rocket_LoadHuds() if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off human_hud.", rocket_hudFile.string ); + Sys::Drop( "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off human_hud.", rocket_hudFile.string ); } if ( *token == '{' ) @@ -434,7 +434,7 @@ void CG_Rocket_LoadHuds() if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off spectator_hud.", rocket_hudFile.string ); + Sys::Drop( "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off spectator_hud.", rocket_hudFile.string ); } if ( *token == '{' ) @@ -473,7 +473,7 @@ void CG_Rocket_LoadHuds() if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off alien_hud.", rocket_hudFile.string ); + Sys::Drop( "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off alien_hud.", rocket_hudFile.string ); } if ( *token == '{' ) @@ -509,7 +509,7 @@ void CG_Rocket_LoadHuds() if ( !*token ) { - Com_Error(errorParm_t::ERR_DROP, "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off %s_hud.", rocket_hudFile.string, BG_Weapon( i )->name ); + Sys::Drop( "Unable to load huds from %s. Unexpected end of file. Expected closing } to close off %s_hud.", rocket_hudFile.string, BG_Weapon( i )->name ); } if ( *token == '{' ) @@ -532,7 +532,7 @@ void CG_Rocket_LoadHuds() if ( !valid ) { - Com_Error(errorParm_t::ERR_DROP, "Could not parse %s. Unrecognized top level item: %s", rocket_hudFile.string, token ); + Sys::Drop( "Could not parse %s. Unrecognized top level item: %s", rocket_hudFile.string, token ); } } } diff --git a/src/cgame/cg_rocket_draw.cpp b/src/cgame/cg_rocket_draw.cpp index 4a009e469fe..91e3ab32cd3 100644 --- a/src/cgame/cg_rocket_draw.cpp +++ b/src/cgame/cg_rocket_draw.cpp @@ -969,7 +969,7 @@ class WeaponIconElement : public HudElement if ( weapon < WP_NONE || weapon >= WP_NUM_WEAPONS ) { - Com_Error(errorParm_t::ERR_DROP, "CG_DrawWeaponIcon: weapon out of range: %d", weapon ); + Sys::Drop( "CG_DrawWeaponIcon: weapon out of range: %d", weapon ); } if ( !cg_weapons[ weapon ].registered ) diff --git a/src/cgame/cg_snapshot.cpp b/src/cgame/cg_snapshot.cpp index 084d0fbe67e..eef397612ed 100644 --- a/src/cgame/cg_snapshot.cpp +++ b/src/cgame/cg_snapshot.cpp @@ -149,12 +149,12 @@ static void CG_TransitionSnapshot() if ( !cg.snap ) { - Com_Error(errorParm_t::ERR_DROP, "CG_TransitionSnapshot: NULL cg.snap" ); + Sys::Drop( "CG_TransitionSnapshot: NULL cg.snap" ); } if ( !cg.nextSnap ) { - Com_Error(errorParm_t::ERR_DROP, "CG_TransitionSnapshot: NULL cg.nextSnap" ); + Sys::Drop( "CG_TransitionSnapshot: NULL cg.nextSnap" ); } // execute any server string commands before transitioning entities @@ -372,7 +372,7 @@ void CG_ProcessSnapshots() if ( n < cg.latestSnapshotNum ) { // this should never happen - Com_Error(errorParm_t::ERR_DROP, "CG_ProcessSnapshots: n (%i) < cg.latestSnapshotNum (%i)", n, cg.latestSnapshotNum ); + Sys::Drop( "CG_ProcessSnapshots: n (%i) < cg.latestSnapshotNum (%i)", n, cg.latestSnapshotNum ); } cg.latestSnapshotNum = n; @@ -421,7 +421,7 @@ void CG_ProcessSnapshots() // if time went backwards, we have a level restart if ( cg.nextSnap->serverTime < cg.snap->serverTime ) { - Com_Error(errorParm_t::ERR_DROP, "CG_ProcessSnapshots: Server time went backwards" ); + Sys::Drop( "CG_ProcessSnapshots: Server time went backwards" ); } } @@ -439,7 +439,7 @@ void CG_ProcessSnapshots() // assert our valid conditions upon exiting if ( cg.snap == nullptr ) { - Com_Error(errorParm_t::ERR_DROP, "CG_ProcessSnapshots: cg.snap == NULL" ); + Sys::Drop( "CG_ProcessSnapshots: cg.snap == NULL" ); } if ( cg.time < cg.snap->serverTime ) @@ -450,6 +450,6 @@ void CG_ProcessSnapshots() if ( cg.nextSnap != nullptr && cg.nextSnap->serverTime <= cg.time ) { - Com_Error(errorParm_t::ERR_DROP, "CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time" ); + Sys::Drop( "CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time" ); } } diff --git a/src/cgame/cg_weapons.cpp b/src/cgame/cg_weapons.cpp index 7bb1180a1c7..33c65990dd8 100644 --- a/src/cgame/cg_weapons.cpp +++ b/src/cgame/cg_weapons.cpp @@ -45,7 +45,7 @@ void CG_RegisterUpgrade( int upgradeNum ) if ( upgradeNum <= UP_NONE || upgradeNum >= UP_NUM_UPGRADES ) { - Com_Error(errorParm_t::ERR_DROP, "CG_RegisterUpgrade: out of range: %d", upgradeNum ); + Sys::Drop( "CG_RegisterUpgrade: out of range: %d", upgradeNum ); } upgradeInfo = &cg_upgrades[ upgradeNum ]; @@ -61,7 +61,7 @@ void CG_RegisterUpgrade( int upgradeNum ) if ( !BG_Upgrade( upgradeNum )->name[ 0 ] ) { - Com_Error(errorParm_t::ERR_DROP, "Couldn't find upgrade %i", upgradeNum ); + Sys::Drop( "Couldn't find upgrade %i", upgradeNum ); } upgradeInfo->humanName = BG_Upgrade( upgradeNum )->humanName; @@ -742,7 +742,7 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t * if ( !CG_RegisterWeaponAnimation( &wi->animations[ WANIM_IDLE ], va( "%s_view.iqm:idle", token2 ), true, false, false ) ) { - //Com_Error(errorParm_t::ERR_DROP, "could not find '%s'", path ); + //Sys::Drop( "could not find '%s'", path ); } // default all weapon animations to the idle animation @@ -835,7 +835,7 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t * if ( !CG_RegisterWeaponAnimation( &wi->animations[ WANIM_IDLE ], va( "%s_view_idle.md5anim", token2 ), true, false, false ) ) { - //Com_Error(errorParm_t::ERR_DROP, "could not find '%s'", path ); + //Sys::Drop( "could not find '%s'", path ); } // default all weapon animations to the idle animation @@ -1157,7 +1157,7 @@ void CG_RegisterWeapon( int weaponNum ) if ( weaponNum <= WP_NONE || weaponNum >= WP_NUM_WEAPONS ) { - Com_Error(errorParm_t::ERR_DROP, "CG_RegisterWeapon: out of range: %d", weaponNum ); + Sys::Drop( "CG_RegisterWeapon: out of range: %d", weaponNum ); } weaponInfo = &cg_weapons[ weaponNum ]; @@ -1173,7 +1173,7 @@ void CG_RegisterWeapon( int weaponNum ) if ( !BG_Weapon( weaponNum )->name[ 0 ] ) { - Com_Error(errorParm_t::ERR_DROP, "Couldn't find weapon %i", weaponNum ); + Sys::Drop( "Couldn't find weapon %i", weaponNum ); } Com_sprintf( path, MAX_QPATH, "models/weapons/%s/weapon.cfg", BG_Weapon( weaponNum )->name ); @@ -1247,7 +1247,7 @@ static void CG_SetWeaponLerpFrameAnimation( weapon_t weapon, lerpFrame_t *lf, in if ( newAnimation < 0 || newAnimation >= MAX_WEAPON_ANIMATIONS ) { - Com_Error(errorParm_t::ERR_DROP, "Bad animation number: %i", newAnimation ); + Sys::Drop( "Bad animation number: %i", newAnimation ); } anim = &cg_weapons[ weapon ].animations[ newAnimation ]; @@ -2636,7 +2636,7 @@ void CG_HandleFireWeapon( centity_t *cent, weaponMode_t weaponMode ) if ( weaponNum >= WP_NUM_WEAPONS ) { - Com_Error(errorParm_t::ERR_DROP, "CG_HandleFireWeapon: ent->weapon >= WP_NUM_WEAPONS" ); + Sys::Drop( "CG_HandleFireWeapon: ent->weapon >= WP_NUM_WEAPONS" ); } wi = &cg_weapons[ weaponNum ]; diff --git a/src/sgame/sg_api.cpp b/src/sgame/sg_api.cpp index b13c47d2c80..79bd093fad1 100644 --- a/src/sgame/sg_api.cpp +++ b/src/sgame/sg_api.cpp @@ -131,24 +131,24 @@ void VM::VMHandleSyscall(uint32_t id, Util::Reader reader) { break; case GAME_SNAPSHOT_CALLBACK: - Com_Error(errorParm_t::ERR_DROP, "GAME_SNAPSHOT_CALLBACK not implemented"); + Sys::Drop("GAME_SNAPSHOT_CALLBACK not implemented"); break; case BOTAI_START_FRAME: - Com_Error(errorParm_t::ERR_DROP, "BOTAI_START_FRAME not implemented"); + Sys::Drop("BOTAI_START_FRAME not implemented"); break; case GAME_MESSAGERECEIVED: - Com_Error(errorParm_t::ERR_DROP, "GAME_MESSAGERECEIVED not implemented"); + Sys::Drop("GAME_MESSAGERECEIVED not implemented"); break; default: - Com_Error(errorParm_t::ERR_DROP, "VMMain(): unknown game command %i", minor); + Sys::Drop("VMMain(): unknown game command %i", minor); } } else if (major < VM::LAST_COMMON_SYSCALL) { VM::HandleCommonSyscall(major, minor, std::move(reader), VM::rootChannel); } else { - Com_Error(errorParm_t::ERR_DROP, "unhandled VM major syscall number %i", major); + Sys::Drop("unhandled VM major syscall number %i", major); } } diff --git a/src/sgame/sg_buildable.cpp b/src/sgame/sg_buildable.cpp index 2228bbe25b0..96fafda6715 100644 --- a/src/sgame/sg_buildable.cpp +++ b/src/sgame/sg_buildable.cpp @@ -1576,7 +1576,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int /*distan break; default: - Com_Error( errorParm_t::ERR_FATAL, "No reason for denying build of %d", buildable ); + Sys::Error( "No reason for denying build of %d", buildable ); break; } } diff --git a/src/sgame/sg_client.cpp b/src/sgame/sg_client.cpp index 4e68a6fa0c8..b5254f4b848 100644 --- a/src/sgame/sg_client.cpp +++ b/src/sgame/sg_client.cpp @@ -180,7 +180,7 @@ gentity_t *G_SelectRandomFurthestSpawnPoint( vec3_t avoidPoint, vec3_t origin, v if ( !spot ) { - Com_Error(errorParm_t::ERR_DROP, "Couldn't find a spawn point" ); + Sys::Drop( "Couldn't find a spawn point" ); } VectorCopy( spot->s.origin, origin ); @@ -1671,7 +1671,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, const vec3_t origin, const v { if ( spawn == nullptr ) { - Com_Error(errorParm_t::ERR_DROP, "ClientSpawn: spawn is NULL" ); + Sys::Drop( "ClientSpawn: spawn is NULL" ); } spawnPoint = spawn; diff --git a/src/sgame/sg_cm_world.cpp b/src/sgame/sg_cm_world.cpp index 13ef305b326..f71d6adb97c 100644 --- a/src/sgame/sg_cm_world.cpp +++ b/src/sgame/sg_cm_world.cpp @@ -49,7 +49,7 @@ worldEntity_t *G_CM_WorldEntityForGentity( gentity_t *gEnt ) { if ( !gEnt || gEnt->s.number < 0 || gEnt->s.number >= MAX_GENTITIES ) { - Com_Error(errorParm_t::ERR_DROP, "G_CM_WorldEntityForGentity: bad gEnt" ); + Sys::Drop( "G_CM_WorldEntityForGentity: bad gEnt" ); } return &wentities[ gEnt->s.number ]; @@ -77,12 +77,12 @@ void G_CM_SetBrushModel( gentity_t *ent, const char *name ) if ( !name ) { - Com_Error(errorParm_t::ERR_DROP, "G_CM_SetBrushModel: NULL for #%i", ent->s.number ); + Sys::Drop( "G_CM_SetBrushModel: NULL for #%i", ent->s.number ); } if ( name[ 0 ] != '*' ) { - Com_Error(errorParm_t::ERR_DROP, "G_CM_SetBrushModel: %s of #%i isn't a brush model", name, ent->s.number ); + Sys::Drop( "G_CM_SetBrushModel: %s of #%i isn't a brush model", name, ent->s.number ); } ent->s.modelindex = atoi( name + 1 ); diff --git a/src/sgame/sg_cmds.cpp b/src/sgame/sg_cmds.cpp index feecc3fa26b..283044149df 100644 --- a/src/sgame/sg_cmds.cpp +++ b/src/sgame/sg_cmds.cpp @@ -1018,7 +1018,7 @@ void G_Say( gentity_t *ent, saymode_t mode, const char *chatText ) // console say_team is handled in g_svscmds, not here if ( !ent || !ent->client ) { - Com_Error( errorParm_t::ERR_FATAL, "SAY_TEAM by non-client entity" ); + Sys::Error( "SAY_TEAM by non-client entity" ); } G_LogPrintf( "SayTeam: %d \"%s^*\": ^5%s", @@ -1028,7 +1028,7 @@ void G_Say( gentity_t *ent, saymode_t mode, const char *chatText ) case SAY_RAW: if ( ent ) { - Com_Error( errorParm_t::ERR_FATAL, "SAY_RAW by client entity" ); + Sys::Error( "SAY_RAW by client entity" ); } G_LogPrintf( "Chat: -1 \"console\": %s", chatText ); @@ -1232,7 +1232,7 @@ void Cmd_VSay_f( gentity_t *ent ) if ( !ent || !ent->client ) { - Com_Error( errorParm_t::ERR_FATAL, "Cmd_VSay_f() called by non-client entity" ); + Sys::Error( "Cmd_VSay_f() called by non-client entity" ); } trap_Argv( 0, arg, sizeof( arg ) ); diff --git a/src/sgame/sg_entities.cpp b/src/sgame/sg_entities.cpp index 354fe094a73..0017138f9bb 100644 --- a/src/sgame/sg_entities.cpp +++ b/src/sgame/sg_entities.cpp @@ -124,7 +124,7 @@ gentity_t *G_NewEntity() Log::Warn( "%4i: %s", i, g_entities[ i ].classname ); } - Com_Error(errorParm_t::ERR_DROP, "G_Spawn: no free entities" ); + Sys::Drop( "G_Spawn: no free entities" ); } // open up a new slot diff --git a/src/sgame/sg_spawn.cpp b/src/sgame/sg_spawn.cpp index 3c532e48072..5fa83cbc18b 100644 --- a/src/sgame/sg_spawn.cpp +++ b/src/sgame/sg_spawn.cpp @@ -42,7 +42,7 @@ bool G_SpawnString( const char *key, const char *defaultString, char **out ) if ( !level.spawning ) { *out = ( char * ) defaultString; -// Com_Error(errorParm_t::ERR_DROP, "G_SpawnString() called while not spawning" ); +// Sys::Drop( "G_SpawnString() called while not spawning" ); return false; } @@ -714,14 +714,14 @@ void G_ParseField( const char *key, const char *rawString, gentity_t *entity ) case F_TARGET: if(entity->targetCount >= MAX_ENTITY_TARGETS) - Com_Error(errorParm_t::ERR_DROP, "Maximal number of %i targets reached.", MAX_ENTITY_TARGETS); + Sys::Drop("Maximal number of %i targets reached.", MAX_ENTITY_TARGETS); ( ( char ** ) entityDataField ) [ entity->targetCount++ ] = G_NewString( rawString ); break; case F_CALLTARGET: if(entity->callTargetCount >= MAX_ENTITY_CALLTARGETS) - Com_Error(errorParm_t::ERR_DROP, "Maximal number of %i calltargets reached. You can solve this by using a Relay.", MAX_ENTITY_CALLTARGETS); + Sys::Drop("Maximal number of %i calltargets reached. You can solve this by using a Relay.", MAX_ENTITY_CALLTARGETS); ( ( gentityCallDefinition_t * ) entityDataField ) [ entity->callTargetCount++ ] = G_NewCallDefinition( fieldDescriptor->replacement ? fieldDescriptor->replacement : fieldDescriptor->name, rawString ); break; @@ -765,7 +765,7 @@ void G_ParseField( const char *key, const char *rawString, gentity_t *entity ) case F_SOUNDINDEX: if ( strlen( rawString ) >= MAX_QPATH ) { - Com_Error(errorParm_t::ERR_DROP, "Sound filename %s in field %s of %s exceeds MAX_QPATH\n", rawString, fieldDescriptor->name, etos( entity ) ); + Sys::Drop( "Sound filename %s in field %s of %s exceeds MAX_QPATH\n", rawString, fieldDescriptor->name, etos( entity ) ); } * ( int * ) entityDataField = G_SoundIndex( rawString ); @@ -917,7 +917,7 @@ char *G_AddSpawnVarToken( const char *string ) if ( level.numSpawnVarChars + l + 1 > MAX_SPAWN_VARS_CHARS ) { - Com_Error(errorParm_t::ERR_DROP, "G_AddSpawnVarToken: MAX_SPAWN_VARS_CHARS" ); + Sys::Drop( "G_AddSpawnVarToken: MAX_SPAWN_VARS_CHARS" ); } dest = level.spawnVarChars + level.numSpawnVarChars; @@ -955,7 +955,7 @@ bool G_ParseSpawnVars() if ( com_token[ 0 ] != '{' ) { - Com_Error(errorParm_t::ERR_DROP, "G_ParseSpawnVars: found %s when expecting {", com_token ); + Sys::Drop( "G_ParseSpawnVars: found %s when expecting {", com_token ); } // go through all the key / value pairs @@ -964,7 +964,7 @@ bool G_ParseSpawnVars() // parse key if ( !trap_GetEntityToken( keyname, sizeof( keyname ) ) ) { - Com_Error(errorParm_t::ERR_DROP, "G_ParseSpawnVars: EOF without closing brace" ); + Sys::Drop( "G_ParseSpawnVars: EOF without closing brace" ); } if ( keyname[ 0 ] == '}' ) @@ -975,17 +975,17 @@ bool G_ParseSpawnVars() // parse value if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) { - Com_Error(errorParm_t::ERR_DROP, "G_ParseSpawnVars: EOF without closing brace" ); + Sys::Drop( "G_ParseSpawnVars: EOF without closing brace" ); } if ( com_token[ 0 ] == '}' ) { - Com_Error(errorParm_t::ERR_DROP, "G_ParseSpawnVars: closing brace without data" ); + Sys::Drop( "G_ParseSpawnVars: closing brace without data" ); } if ( level.numSpawnVars == MAX_SPAWN_VARS ) { - Com_Error(errorParm_t::ERR_DROP, "G_ParseSpawnVars: MAX_SPAWN_VARS" ); + Sys::Drop( "G_ParseSpawnVars: MAX_SPAWN_VARS" ); } level.spawnVars[ level.numSpawnVars ][ 0 ] = G_AddSpawnVarToken( keyname ); @@ -1024,7 +1024,7 @@ void SP_worldspawn() if ( Q_stricmp( s, S_WORLDSPAWN ) ) { - Com_Error(errorParm_t::ERR_DROP, "SP_worldspawn: The first entry in the spawn string isn't of expected type '" S_WORLDSPAWN "'" ); + Sys::Drop( "SP_worldspawn: The first entry in the spawn string isn't of expected type '" S_WORLDSPAWN "'" ); } // make some data visible to connecting client @@ -1100,7 +1100,7 @@ void G_SpawnEntitiesFromString() // needed by a level (setting configstrings or cvars, etc) if ( !G_ParseSpawnVars() ) { - Com_Error(errorParm_t::ERR_DROP, "SpawnEntities: no entities" ); + Sys::Drop( "SpawnEntities: no entities" ); } SP_worldspawn(); diff --git a/src/sgame/sg_spawn_fx.cpp b/src/sgame/sg_spawn_fx.cpp index fc18ac84b27..7cf5664bbbd 100644 --- a/src/sgame/sg_spawn_fx.cpp +++ b/src/sgame/sg_spawn_fx.cpp @@ -81,7 +81,7 @@ void SP_sfx_speaker( gentity_t *self ) if ( !G_SpawnString( "noise", "NOSOUND", &tmpString ) ) { - Com_Error(errorParm_t::ERR_DROP, "speaker %s without a noise key", etos( self ) ); + Sys::Drop( "speaker %s without a noise key", etos( self ) ); } // force all client-relative sounds to be "activator" speakers that diff --git a/src/sgame/sg_spawn_mover.cpp b/src/sgame/sg_spawn_mover.cpp index 528e051e5c8..e791de9e063 100644 --- a/src/sgame/sg_spawn_mover.cpp +++ b/src/sgame/sg_spawn_mover.cpp @@ -161,7 +161,7 @@ bool G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, vec3_ // save off the old position if ( pushed_p > &pushed[ MAX_GENTITIES ] ) { - Com_Error(errorParm_t::ERR_DROP, "pushed_p > &pushed[MAX_GENTITIES]" ); + Sys::Drop( "pushed_p > &pushed[MAX_GENTITIES]" ); } pushed_p->ent = check; @@ -939,7 +939,7 @@ void BinaryMover_reached( gentity_t *ent ) } else { - Com_Error(errorParm_t::ERR_DROP, "Reached_BinaryMover: bad moverState" ); + Sys::Drop( "Reached_BinaryMover: bad moverState" ); } } @@ -1180,7 +1180,7 @@ void reset_moverspeed( gentity_t *self, float fallbackSpeed ) float distance; if(!fallbackSpeed) - Com_Error(errorParm_t::ERR_DROP, "No default speed was supplied to reset_moverspeed for entity #%i of type %s.\n", self->s.number, self->classname); + Sys::Drop("No default speed was supplied to reset_moverspeed for entity #%i of type %s.\n", self->s.number, self->classname); G_ResetFloatField(&self->speed, true, self->config.speed, self->eclass->config.speed, fallbackSpeed); @@ -1297,7 +1297,7 @@ void reset_rotatorspeed( gentity_t *self, float fallbackSpeed ) float angle; if(!fallbackSpeed) - Com_Error(errorParm_t::ERR_DROP, "No default speed was supplied to reset_rotatorspeed for entity #%i of type %s.\n", self->s.number, self->classname); + Sys::Drop("No default speed was supplied to reset_rotatorspeed for entity #%i of type %s.\n", self->s.number, self->classname); // calculate time to reach second position from speed VectorSubtract( self->activatedPosition, self->restingPosition, move ); diff --git a/src/sgame/sg_utils.cpp b/src/sgame/sg_utils.cpp index ec35b2f9e59..07787eaffcf 100644 --- a/src/sgame/sg_utils.cpp +++ b/src/sgame/sg_utils.cpp @@ -132,7 +132,7 @@ static int G_FindConfigstringIndex( const char *name, int start, int max, bool c if ( i == max ) { - Com_Error(errorParm_t::ERR_DROP, "G_FindConfigstringIndex: overflow" ); + Sys::Drop( "G_FindConfigstringIndex: overflow" ); } trap_SetConfigstring( start + i, name ); diff --git a/src/shared/bg_misc.cpp b/src/shared/bg_misc.cpp index a69d3a7b1a1..e4f932ef892 100644 --- a/src/shared/bg_misc.cpp +++ b/src/shared/bg_misc.cpp @@ -1180,7 +1180,7 @@ void BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result ) break; default: - Com_Error(errorParm_t::ERR_DROP, "BG_EvaluateTrajectory: unknown trType: %i", tr->trTime ); + Sys::Drop( "BG_EvaluateTrajectory: unknown trType: %i", tr->trTime ); } } @@ -1237,7 +1237,7 @@ void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t resu break; default: - Com_Error(errorParm_t::ERR_DROP, "BG_EvaluateTrajectoryDelta: unknown trType: %i", tr->trTime ); + Sys::Drop( "BG_EvaluateTrajectoryDelta: unknown trType: %i", tr->trTime ); } } @@ -2194,7 +2194,7 @@ void BG_PackEntityNumbers( entityState_t *es, const int *entityNums, unsigned in if ( entityNum & ~GENTITYNUM_MASK ) { - Com_Error( errorParm_t::ERR_FATAL, "BG_PackEntityNumbers passed an entity number (%d) which " + Sys::Error( "BG_PackEntityNumbers passed an entity number (%d) which " "exceeds %d bits", entityNum, GENTITYNUM_BITS ); } @@ -2241,7 +2241,7 @@ void BG_PackEntityNumbers( entityState_t *es, const int *entityNums, unsigned in break; default: - Com_Error( errorParm_t::ERR_FATAL, "Entity index %d not handled", i ); + Sys::Error( "Entity index %d not handled", i ); } } } @@ -2309,7 +2309,7 @@ int BG_UnpackEntityNumbers( entityState_t *es, int *entityNums, unsigned int cou break; default: - Com_Error( errorParm_t::ERR_FATAL, "Entity index %d not handled", i ); + Sys::Error( "Entity index %d not handled", i ); } *entityNum &= GENTITYNUM_MASK; diff --git a/src/shared/bg_teamprogress.cpp b/src/shared/bg_teamprogress.cpp index 5bc1e3ddf42..e254377bd20 100644 --- a/src/shared/bg_teamprogress.cpp +++ b/src/shared/bg_teamprogress.cpp @@ -74,7 +74,7 @@ static const char *UnlockableHumanName( unlockable_t *unlockable ) case UNLT_CLASS: return BG_ClassModelConfig( unlockable->num )->humanName; } - Com_Error( errorParm_t::ERR_FATAL, "UnlockableHumanName: Unlockable has unknown type" ); + Sys::Error( "UnlockableHumanName: Unlockable has unknown type" ); return nullptr; } @@ -89,7 +89,7 @@ static bool Disabled( unlockable_t *unlockable ) case UNLT_CLASS: return BG_ClassDisabled( unlockable->num ); } - Com_Error( errorParm_t::ERR_FATAL, "Disabled: Unlockable has unknown type" ); + Sys::Error( "Disabled: Unlockable has unknown type" ); return false; } #endif // BUILD_CGAME @@ -310,7 +310,7 @@ void BG_ImportUnlockablesFromMask( int team, int mask ) break; default: - Com_Error( errorParm_t::ERR_FATAL, "BG_ImportUnlockablesFromMask: Unknown unlockable type" ); + Sys::Error( "BG_ImportUnlockablesFromMask: Unknown unlockable type" ); } unlockThreshold = std::max( unlockThreshold, 0 ); @@ -378,7 +378,7 @@ int BG_UnlockablesMask( int team ) { if ( unlockablesTeamKnowledge != team && unlockablesTeamKnowledge != TEAM_ALL ) { - Com_Error( errorParm_t::ERR_FATAL, "BG_UnlockablesMask: Requested mask for a team with unknown unlockable status" ); + Sys::Error( "BG_UnlockablesMask: Requested mask for a team with unknown unlockable status" ); } return unlockablesMask[ team ]; @@ -501,12 +501,12 @@ static void UpdateUnlockablesMask() if ( unlockableNum[ team ] > 15 ) // 16 bit available for transmission { - Com_Error( errorParm_t::ERR_FATAL, "UpdateUnlockablesMask: Number of unlockable items for a team exceeded" ); + Sys::Error( "UpdateUnlockablesMask: Number of unlockable items for a team exceeded" ); } if ( !unlockables[ unlockable ].statusKnown ) { - Com_Error( errorParm_t::ERR_FATAL, "UpdateUnlockablesMask: Called before G_UpdateUnlockables" ); + Sys::Error( "UpdateUnlockablesMask: Called before G_UpdateUnlockables" ); } if ( unlockables[ unlockable ].unlocked ) @@ -564,7 +564,7 @@ void G_UpdateUnlockables() break; default: - Com_Error( errorParm_t::ERR_FATAL, "G_UpdateUnlockables: Unknown unlockable type" ); + Sys::Error( "G_UpdateUnlockables: Unknown unlockable type" ); } unlockThreshold = std::max( unlockThreshold, 0 ); diff --git a/src/shared/bg_voice.cpp b/src/shared/bg_voice.cpp index 19494e659e6..d02d84ed730 100644 --- a/src/shared/bg_voice.cpp +++ b/src/shared/bg_voice.cpp @@ -51,7 +51,7 @@ static void NORETURN BG_VoiceParseError( fileHandle_t handle, const char *err ) Parse_SourceFileAndLine( handle, filename, &line ); Parse_FreeSourceHandle( handle ); - Com_Error( errorParm_t::ERR_FATAL, "%s on line %d of %s", err, line, filename ); + Sys::Error( "%s on line %d of %s", err, line, filename ); } /* @@ -449,7 +449,7 @@ static voiceCmd_t *BG_VoiceParse( const char *name ) char filename[ MAX_QPATH ]; Parse_SourceFileAndLine( handle, filename, &line ); - Com_Error( errorParm_t::ERR_FATAL, "BG_VoiceParse(): " + Sys::Error( "BG_VoiceParse(): " "parse error on line %d of %s", line, filename ); } } @@ -460,7 +460,7 @@ static voiceCmd_t *BG_VoiceParse( const char *name ) char filename[ MAX_QPATH ]; Parse_SourceFileAndLine( handle, filename, &line ); - Com_Error( errorParm_t::ERR_FATAL, "BG_VoiceParse(): " + Sys::Error( "BG_VoiceParse(): " "command \"%s\" exceeds MAX_VOICE_CMD_LEN (%d) on line %d of %s", token.string, MAX_VOICE_CMD_LEN, line, filename ); } diff --git a/src/shared/parse.cpp b/src/shared/parse.cpp index 9a36c9158ba..024f89fb72f 100644 --- a/src/shared/parse.cpp +++ b/src/shared/parse.cpp @@ -1358,7 +1358,7 @@ static token_t *Parse_CopyToken( token_t *token ) // t = freetokens; if ( !t ) { - Com_Error( errorParm_t::ERR_FATAL, "out of token space" ); + Sys::Error( "out of token space" ); return nullptr; }