]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
trying to fix many forward references in input code
[xonotic/darkplaces.git] / sv_main.c
index f873dfe03edc63515776278776fb92a898a581e5..9dd462f3db55fc27c121c9f2517a3a1590a9e45d 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -383,6 +383,7 @@ void SV_CheckForNewClients (void)
                SV_ConnectClient (i);
 
                net_activeconnections++;
+               NET_Heartbeat ();
        }
 }
 
@@ -863,7 +864,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
 #else
 void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
 {
-       int e, clentnum, flags, alpha, glowcolor, glowsize, scale, effects;
+       int e, clentnum, flags, alpha, glowcolor, glowsize, scale, effects, modelindex;
        int culled_pvs, culled_portal, culled_trace, visibleentities, totalentities;
        float alphaf, lightsize;
        qbyte *pvs;
@@ -966,8 +967,10 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
                        lightsize = max(lightsize, 100);
                }
 
+               modelindex = 0;
                if (ent->v.modelindex >= 0 && ent->v.modelindex < MAX_MODELS && pr_strings[ent->v.model])
                {
+                       modelindex = ent->v.modelindex;
                        model = sv.models[(int)ent->v.modelindex];
                        Mod_CheckLoaded(model);
                }
@@ -1137,7 +1140,7 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
                s->colormap = ent->v.colormap;
                s->skin = ent->v.skin;
                s->frame = ent->v.frame;
-               s->modelindex = ent->v.modelindex;
+               s->modelindex = modelindex;
                s->effects = effects;
                s->alpha = alpha;
                s->scale = scale;
@@ -1840,5 +1843,6 @@ void SV_SpawnServer (const char *server)
                        SV_SendServerinfo (host_client);
 
        Con_DPrintf ("Server spawned.\n");
+       NET_Heartbeat ();
 }