changed a lot of Host_Error calls to Con_Printf or Sys_Error according to severity
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jun 2005 17:35:17 +0000 (17:35 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jun 2005 17:35:17 +0000 (17:35 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5460 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
cl_particles.c
collision.c
common.c
r_lerpanim.c
snd_main.c
snd_wav.c
sv_main.c
sv_phys.c
svvm_cmds.c
world.c

index 5e4a52c..d638d18 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -190,7 +190,7 @@ void CL_ExpandEntities(int num)
        if (num >= cl_max_entities)
        {
                if (!cl_entities)
-                       Host_Error("CL_ExpandEntities: cl_entities not initialized\n");
+                       Sys_Error("CL_ExpandEntities: cl_entities not initialized\n");
                if (num >= MAX_EDICTS)
                        Host_Error("CL_ExpandEntities: num %i >= %i\n", num, MAX_EDICTS);
                oldmaxentities = cl_max_entities;
index 235a542..ef30aad 100644 (file)
@@ -955,7 +955,7 @@ void CL_ParticleRain (vec3_t mins, vec3_t maxs, vec3_t dir, int count, int color
                }
                break;
        default:
-               Host_Error("CL_ParticleRain: unknown type %i (0 = rain, 1 = snow)\n", type);
+               Con_Printf ("CL_ParticleRain: unknown type %i (0 = rain, 1 = snow)\n", type);
        }
 }
 
@@ -2025,7 +2025,10 @@ void R_DrawParticleCallback(const void *calldata1, int calldata2)
                particle_texcoord2f[6] = 1;particle_texcoord2f[7] = v[1];
        }
        else
-               Host_Error("R_DrawParticles: unknown particle orientation %i\n", p->type->orientation);
+       {
+               Con_Printf("R_DrawParticles: unknown particle orientation %i\n", p->type->orientation);
+               return;
+       }
 
 #if WORKINGLQUAKE
        if (blendmode == PBLEND_ALPHA)
index 88a4795..30f4d76 100644 (file)
@@ -511,7 +511,7 @@ colbrushf_t *Collision_AllocBrushFromPermanentPolygonFloat(mempool_t *mempool, i
        brush->numplanes = numpoints + 2;
        brush->planes = (void *)(brush + 1);
        brush->points = (colpointf_t *)points;
-       Host_Error("Collision_AllocBrushFromPermanentPolygonFloat: FIXME: this code needs to be updated to generate a mesh...\n");
+       Sys_Error("Collision_AllocBrushFromPermanentPolygonFloat: FIXME: this code needs to be updated to generate a mesh...\n");
        return brush;
 }
 
index 6019461..bfdb26e 100644 (file)
--- a/common.c
+++ b/common.c
@@ -283,8 +283,6 @@ void MSG_WriteCoord (sizebuf_t *sb, float f, protocolversion_t protocol)
                MSG_WriteCoord16i (sb, f);
        else
                MSG_WriteCoord32f (sb, f);
-       //else
-       //      Host_Error("MSG_WriteCoord: unknown protocol\n");
 }
 
 void MSG_WriteVector (sizebuf_t *sb, float *v, protocolversion_t protocol)
index f736a11..831a16e 100644 (file)
@@ -32,7 +32,10 @@ void R_LerpAnimation(entity_render_t *r)
 
        // note: this could be removed, if the rendering code allows an empty blend array
        if (r->frame1 < 0)
-               Host_Error ("CL_LerpAnimation: frame1 is NULL\n");
+       {
+               Con_Printf ("CL_LerpAnimation: frame1 is NULL\n");
+               r->frame1 = 0;
+       }
 
        // check r_lerpmodels and round off very close blend percentages
        if (!r_lerpmodels.integer)
index 365ebf8..1e9fd6e 100644 (file)
@@ -257,7 +257,10 @@ sfx_t *S_FindName (const char *name)
                return NULL;
 
        if (strlen (name) >= sizeof (sfx->name))
-               Host_Error ("S_FindName: sound name too long (%s)", name);
+       {
+               Con_Printf ("S_FindName: sound name too long (%s)", name);
+               return NULL;
+       }
 
        // Look for this sound in the list of known sfx
        for (sfx = known_sfx; sfx != NULL; sfx = sfx->next)
index ff4bb40..041a255 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -204,7 +204,10 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
        if (info.samples)
        {
                if (samples < info.samples)
-                       Host_Error ("Sound %s has a bad loop length", name);
+               {
+                       Con_Printf ("Sound %s has a bad loop length", name);
+                       info.samples = samples;
+               }
        }
        else
                info.samples = samples;
index 63dd5a8..f811ee6 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -209,13 +209,22 @@ void SV_StartSound (prvm_edict_t *entity, int channel, const char *sample, int v
        int sound_num, field_mask, i, ent;
 
        if (volume < 0 || volume > 255)
-               Host_Error ("SV_StartSound: volume = %i", volume);
+       {
+               Con_Printf ("SV_StartSound: volume = %i", volume);
+               return;
+       }
 
        if (attenuation < 0 || attenuation > 4)
-               Host_Error ("SV_StartSound: attenuation = %f", attenuation);
+       {
+               Con_Printf ("SV_StartSound: attenuation = %f", attenuation);
+               return;
+       }
 
        if (channel < 0 || channel > 7)
-               Host_Error ("SV_StartSound: channel = %i", channel);
+       {
+               Con_Printf ("SV_StartSound: channel = %i", channel);
+               return;
+       }
 
        if (sv.datagram.cursize > MAX_PACKETFRAGMENT-21)
                return;
index e4ca6e6..4ea6348 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -313,7 +313,10 @@ int SV_FlyMove (prvm_edict_t *ent, float time, float *stepnormal)
                }
 
                if (!trace.ent)
-                       Host_Error("SV_FlyMove: !trace.ent");
+               {
+                       Con_Printf ("SV_FlyMove: !trace.ent");
+                       trace.ent = prog->edicts;
+               }
 
                if (((int) ent->fields.server->flags & FL_ONGROUND) && ent->fields.server->groundentity == PRVM_EDICT_TO_PROG(trace.ent))
                        impact = false;
@@ -1433,7 +1436,7 @@ void SV_Physics_Entity (prvm_edict_t *ent, qboolean runmove)
                }
                break;
        default:
-               Host_Error ("SV_Physics: bad movetype %i", (int)ent->fields.server->movetype);
+               Con_Printf ("SV_Physics: bad movetype %i", (int)ent->fields.server->movetype);
                break;
        }
 
index fe00a44..5dae1f9 100644 (file)
@@ -1182,18 +1182,20 @@ sizebuf_t *WriteDest (void)
                ent = PRVM_PROG_TO_EDICT(prog->globals.server->msg_entity);
                entnum = PRVM_NUM_FOR_EDICT(ent);
                if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
-                       Host_Error("WriteDest: tried to write to non-client\n");
-               return &svs.clients[entnum-1].message;
+               {
+                       Con_Printf ("WriteDest: tried to write to non-client\n");
+                       return &sv.reliable_datagram;
+               }
+               else
+                       return &svs.clients[entnum-1].message;
 
+       default:
+               Con_Printf ("WriteDest: bad destination");
        case MSG_ALL:
                return &sv.reliable_datagram;
 
        case MSG_INIT:
                return &sv.signon;
-
-       default:
-               Host_Error("WriteDest: bad destination");
-               break;
        }
 
        return NULL;
diff --git a/world.c b/world.c
index cad831b..da7c671 100644 (file)
--- a/world.c
+++ b/world.c
@@ -270,7 +270,10 @@ void SV_LinkEdict_AreaGrid(prvm_edict_t *ent)
        int igrid[3], igridmins[3], igridmaxs[3], gridnum, entitynumber = PRVM_NUM_FOR_EDICT(ent);
 
        if (entitynumber <= 0 || entitynumber >= prog->max_edicts || PRVM_EDICT_NUM(entitynumber) != ent)
-               Host_Error("SV_LinkEdict_AreaGrid: invalid edict %p (edicts is %p, edict compared to prog->edicts is %i)\n", ent, prog->edicts, entitynumber);
+       {
+               Con_Printf ("SV_LinkEdict_AreaGrid: invalid edict %p (edicts is %p, edict compared to prog->edicts is %i)\n", ent, prog->edicts, entitynumber);
+               return;
+       }
 
        igridmins[0] = (int) ((ent->fields.server->absmin[0] + sv_areagrid_bias[0]) * sv_areagrid_scale[0]);
        igridmins[1] = (int) ((ent->fields.server->absmin[1] + sv_areagrid_bias[1]) * sv_areagrid_scale[1]);