ent file support

This commit is contained in:
Bill Currie 2003-03-25 17:49:27 +00:00
parent 87a31439e4
commit 25a7216b8c
2 changed files with 15 additions and 2 deletions

View file

@ -36,6 +36,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/msg.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "compat.h"
#include "host.h"
@ -898,6 +899,7 @@ SV_SaveSpawnparms (void)
void
SV_SpawnServer (const char *server)
{
char *buf;
int i;
edict_t *ent;
@ -1007,7 +1009,12 @@ SV_SpawnServer (const char *server)
// serverflags are for cross level information (sigils)
*sv_globals.serverflags = svs.serverflags;
ED_LoadFromFile (&sv_pr_state, sv.worldmodel->entities);
if ((buf = QFS_LoadFile (va ("maps/%s.ent", server), 0))) {
ED_LoadFromFile (&sv_pr_state, buf);
free (buf);
} else {
ED_LoadFromFile (&sv_pr_state, sv.worldmodel->entities);
}
sv.active = true;

View file

@ -302,6 +302,7 @@ SV_CheckModel (const char *mdl)
void
SV_SpawnServer (const char *server)
{
char *buf;
edict_t *ent;
int i;
@ -411,7 +412,12 @@ SV_SpawnServer (const char *server)
SV_ProgStartFrame ();
// load and spawn all other entities
ED_LoadFromFile (&sv_pr_state, sv.worldmodel->entities);
if ((buf = QFS_LoadFile (va ("maps/%s.ent", server), 0))) {
ED_LoadFromFile (&sv_pr_state, buf);
free (buf);
} else {
ED_LoadFromFile (&sv_pr_state, sv.worldmodel->entities);
}
// look up some model indexes for specialized message compression
SV_FindModelNumbers ();