]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
don't print PRVM_NAME in each dprint call, it looks terrible (prints multiple times...
[xonotic/darkplaces.git] / sv_main.c
index 1d87bb9d23f1c74a069e26394d489a708e3353b7..019ad9d49370bd8a67609543b6c1bad2c822482a 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;
@@ -408,6 +417,8 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection)
        else
        {
                // call the progs to get default spawn parms for the new client
+               // set self to world to intentionally cause errors with broken SetNewParms code in some mods
+               prog->globals.server->self = 0;
                PRVM_ExecuteProgram (prog->globals.server->SetNewParms, "QC function SetNewParms is missing");
                for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
                        client->spawn_parms[i] = (&prog->globals.server->parm1)[i];
@@ -1725,6 +1736,7 @@ void SV_SpawnServer (const char *server)
        //prog->num_edicts = svs.maxclients+1;
 
        sv.state = ss_loading;
+       prog->allowworldwrites = true;
        sv.paused = false;
 
        *prog->time = sv.time = 1.0;
@@ -1795,6 +1807,7 @@ void SV_SpawnServer (const char *server)
 
 // all setup is completed, any further precache statements are errors
        sv.state = ss_active;
+       prog->allowworldwrites = false;
 
 // run two frames to allow everything to settle
        for (i = 0;i < 2;i++)
@@ -2207,7 +2220,7 @@ void SV_VM_Setup(void)
        prog->load_edict = SV_VM_CB_LoadEdict;
        prog->init_cmd = VM_SV_Cmd_Init;
        prog->reset_cmd = VM_SV_Cmd_Reset;
-       prog->error_cmd = NULL; // change this
+       prog->error_cmd = Host_Error;
 
        // TODO: add a requiredfuncs list (ask LH if this is necessary at all)
        PRVM_LoadProgs( sv_progs.string, 0, NULL, REQFIELDS, reqfields );