]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
changed the flat bump texture (for no bumpmap textures) to have a 128 height instead...
[xonotic/darkplaces.git] / sv_main.c
index d4b6b2d50552436570e197a2c597ee6beb5b40cf..8005c874810e89418eb1fdfd61cd5f77bb18c817 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -452,6 +452,7 @@ void SV_PrepareEntitiesForSending(void)
        int e, i;
        float f;
        edict_t *ent;
+       eval_t *val;
        entity_state_t cs;
        // send all entities that touch the pvs
        numsendentities = 0;
@@ -483,6 +484,16 @@ void SV_PrepareEntitiesForSending(void)
                if (GETEDICTFIELDVALUE(ent, eval_glow_trail)->_float)
                        cs.flags |= RENDER_GLOWTRAIL;
 
+               // don't need to init cs.colormod because the defaultstate did that for us
+               //cs.colormod[0] = cs.colormod[1] = cs.colormod[2] = 32;
+               val = GETEDICTFIELDVALUE(ent, eval_colormod);
+               if (val->vector[0] || val->vector[1] || val->vector[2])
+               {
+                       i = val->vector[0] * 32.0f;cs.colormod[0] = bound(0, i, 255);
+                       i = val->vector[1] * 32.0f;cs.colormod[1] = bound(0, i, 255);
+                       i = val->vector[2] * 32.0f;cs.colormod[2] = bound(0, i, 255);
+               }
+
                cs.modelindex = 0;
                i = (int)ent->v->modelindex;
                if (i >= 1 && i < MAX_MODELS && *PR_GetString(ent->v->model))
@@ -1343,7 +1354,7 @@ int SV_ModelIndex(char *s, int precachemode)
                                        Con_Printf("SV_ModelIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
                                strlcpy(sv.model_precache[i], filename, sizeof(sv.model_precache[i]));
                                sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, false);
-                               if (sv.protocol == PROTOCOL_DARKPLACES6)
+                               if (sv.protocol == PROTOCOL_DARKPLACES6 && sv.state != ss_loading)
                                {
                                        MSG_WriteByte(&sv.reliable_datagram, svc_precache);
                                        MSG_WriteShort(&sv.reliable_datagram, i);
@@ -1391,7 +1402,7 @@ int SV_SoundIndex(char *s, int precachemode)
                                if (precachemode == 1)
                                        Con_Printf("SV_SoundIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
                                strlcpy(sv.sound_precache[i], filename, sizeof(sv.sound_precache[i]));
-                               if (sv.protocol == PROTOCOL_DARKPLACES6)
+                               if (sv.protocol == PROTOCOL_DARKPLACES6 && sv.state != ss_loading)
                                {
                                        MSG_WriteByte(&sv.reliable_datagram, svc_precache);
                                        MSG_WriteShort(&sv.reliable_datagram, i + 32768);
@@ -1596,6 +1607,9 @@ void SV_SpawnServer (const char *server)
 
        Con_DPrintf("SpawnServer: %s\n", server);
 
+       if (cls.state != ca_dedicated)
+               SCR_BeginLoadingPlaque();
+
        snprintf (modelname, sizeof(modelname), "maps/%s.bsp", server);
        worldmodel = Mod_ForName(modelname, false, true, true);
        if (!worldmodel || !worldmodel->TraceBox)