]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 5e4a52c1ea4fd8413bd4a3b8c053bc489b284b62..d638d18598e827bcfd0478a5df1321eeb41e87d5 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 235a5424f4f58418b8d99d90f7fc9a11e489eed4..ef30aad873bdb99fbae5dd93e58043a36e758a2b 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 88a479513beb7777e2d2d5348b8377755d2f352d..30f4d7662acdae19488a51c9d22811a30c4c901f 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 6019461a4be949316a6f23a12913af0e74f593c9..bfdb26ee0ee56f8f40886e9ad6e8f35420395392 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 f736a11ccc31b3e2b96c9b208c43a9995ca76920..831a16e42380f33b4323cd66d4819bd7077527bc 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 365ebf85cc0affeb4fbd6da0c254bec8a73180af..1e9fd6ecc7812ba7487b9f1ae32f04e4248b3717 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 ff4bb4069f3c56845ef279e8cdf3358a8433006b..041a25524cd6ded477c4611eb71fd5ccfa0f856b 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 63dd5a81d7767e23814306232899d9243184ce02..f811ee66cbc2bb1e6be57a617a27e0076a45ab85 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 e4ca6e6619bdc8b3afa89cad61ab46e02974db16..4ea6348410597f5594eb7867fa5470ba7cd31e72 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 fe00a4458f4cf159fb6730ff791ba031a5bcf188..5dae1f94f7765530b0a5aebd685b089998c22732 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 cad831b37059250ed66e4513488a4e60f01ad890..da7c6713a9539f3ebcab641e1cff4a33bacb51b2 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]);