double SV_Frame(double time);
void SV_Shutdown(void);
-int SV_IsLocalGame(void);
+int SV_IsLocalServer(void);
void SV_StartParticle (vec3_t org, vec3_t dir, int color, int count);
void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate);
void SV_ApplyClientMove (void);
void SV_SaveSpawnparms (void);
-qbool SV_IsLocalServer(void);
void SV_SpawnServer (const char *map);
void SV_CheckVelocity (prvm_edict_t *ent);
static qbool SV_CanSave(void)
{
prvm_prog_t *prog = SVVM_prog;
- if(SV_IsLocalGame() == 1)
+ if(SV_IsLocalServer() == 1)
{
// singleplayer checks
if ((svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag)))
}
}
-qbool SV_IsLocalServer(void)
+// Returns 1 if we're singleplayer, > 1 if we're a listen server
+int SV_IsLocalServer(void)
{
- if(host_isclient.integer && host_client && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) == LHNETADDRESSTYPE_LOOP)
- return true;
- return false;
+ return (host_isclient.integer && sv.active ? svs.maxclients : 0);
}
/*
// SV_UnlockThreadMutex();
}
-/*
- * Returns number of slots if we're a listen server.
- * Returns 0 if we're a dedicated server.
- */
-int SV_IsLocalGame(void)
-{
- if (sv.active && &svs.clients[0] && LHNETADDRESS_GetAddressType(&svs.clients[0].netconnection->peeraddress) == LHNETADDRESSTYPE_LOOP)
- return svs.maxclients;
- return 0;
-}
-
/*
==================
SV_Shutdown