mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-22 03:51:13 +00:00
Funktionierende Savegames, vielleichet...
This commit is contained in:
parent
75ec3fea54
commit
5a6e8255b6
1 changed files with 161 additions and 137 deletions
60
src/g_save.c
60
src/g_save.c
|
@ -6,16 +6,11 @@ mmove_t mmove_reloc;
|
|||
|
||||
field_t fields[] = {
|
||||
{"classname", FOFS(classname), F_LSTRING},
|
||||
{"origin", FOFS(s.origin), F_VECTOR},
|
||||
{"model", FOFS(model), F_LSTRING},
|
||||
{"model2", FOFS(model2), F_LSTRING},
|
||||
{"model3", FOFS(model3), F_LSTRING},
|
||||
{"model4", FOFS(model4), F_LSTRING},
|
||||
{"spawnflags", FOFS(spawnflags), F_INT},
|
||||
{"speed", FOFS(speed), F_FLOAT},
|
||||
{"accel", FOFS(accel), F_FLOAT},
|
||||
{"decel", FOFS(decel), F_FLOAT},
|
||||
{"aspeed", FOFS(aspeed), F_FLOAT},
|
||||
{"target", FOFS(target), F_LSTRING},
|
||||
{"targetname", FOFS(targetname), F_LSTRING},
|
||||
{"pathtarget", FOFS(pathtarget), F_LSTRING},
|
||||
|
@ -35,17 +30,24 @@ field_t fields[] = {
|
|||
{"sounds", FOFS(sounds), F_INT},
|
||||
{"light", 0, F_IGNORE},
|
||||
{"dmg", FOFS(dmg), F_INT},
|
||||
{"angles", FOFS(s.angles), F_VECTOR},
|
||||
{"angle", FOFS(s.angles), F_ANGLEHACK},
|
||||
{"mangle", FOFS(mangle), F_VECTOR},
|
||||
{"mass", FOFS(mass), F_INT},
|
||||
{"volume", FOFS(volume), F_FLOAT},
|
||||
{"attenuation", FOFS(attenuation), F_FLOAT},
|
||||
{"map", FOFS(map), F_LSTRING},
|
||||
{"origin", FOFS(s.origin), F_VECTOR},
|
||||
{"angles", FOFS(s.angles), F_VECTOR},
|
||||
{"angle", FOFS(s.angles), F_ANGLEHACK},
|
||||
|
||||
// Knightmare- hack for setting alpha, allows mappers to specify
|
||||
// an entity's alpha value with the key "salpha"
|
||||
#ifdef KMQUAKE2_ENGINE_MOD
|
||||
{"salpha", FOFS(s.alpha), F_FLOAT},
|
||||
#endif
|
||||
|
||||
// zaero
|
||||
{"mangle", FOFS(mangle), F_VECTOR},
|
||||
{"active", FOFS(active), F_INT},
|
||||
{"spawnflags2", FOFS(spawnflags2), F_INT},
|
||||
{"mins", FOFS(mins), F_VECTOR},
|
||||
{"maxs", FOFS(maxs), F_VECTOR},
|
||||
{"mteam", FOFS(mteam), F_LSTRING},
|
||||
{"mirrortarget", 0, F_IGNORE},
|
||||
{"mirrorlevelsave", 0, F_IGNORE},
|
||||
|
@ -57,6 +59,10 @@ field_t fields[] = {
|
|||
{"noise", STOFS(noise), F_LSTRING, FFL_SPAWNTEMP},
|
||||
{"pausetime", STOFS(pausetime), F_FLOAT, FFL_SPAWNTEMP},
|
||||
{"item", STOFS(item), F_LSTRING, FFL_SPAWNTEMP},
|
||||
|
||||
//need for item field in edict struct, FFL_SPAWNTEMP item will be skipped on saves
|
||||
{"item", FOFS(item), F_ITEM},
|
||||
|
||||
{"gravity", STOFS(gravity), F_LSTRING, FFL_SPAWNTEMP},
|
||||
{"sky", STOFS(sky), F_LSTRING, FFL_SPAWNTEMP},
|
||||
{"skyrotate", STOFS(skyrotate), F_FLOAT, FFL_SPAWNTEMP},
|
||||
|
@ -90,8 +96,8 @@ field_t clientfields[] =
|
|||
{"newweapon", CLOFS(newweapon), F_ITEM},
|
||||
|
||||
// evolve
|
||||
{"zCameraTrack", CLOFS(zCameraTrack), F_EDICT},
|
||||
{"zCameraLocalEntitiy", CLOFS(zCameraLocalEntity), F_EDICT},
|
||||
{"", CLOFS(zCameraTrack), F_EDICT},
|
||||
{"", CLOFS(zCameraLocalEntity), F_EDICT},
|
||||
|
||||
{NULL, 0, F_INT}
|
||||
};
|
||||
|
@ -128,17 +134,23 @@ void InitGame (void)
|
|||
gi.cvar ("gamedate", __DATE__ , CVAR_SERVERINFO | CVAR_LATCH);
|
||||
|
||||
maxclients = gi.cvar ("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH);
|
||||
//maxspectators = gi.cvar ("maxspectators", "4", CVAR_SERVERINFO);
|
||||
deathmatch = gi.cvar ("deathmatch", "0", CVAR_LATCH);
|
||||
coop = gi.cvar ("coop", "0", CVAR_LATCH);
|
||||
skill = gi.cvar ("skill", "1", CVAR_LATCH);
|
||||
maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
|
||||
|
||||
//Knightmare- increase maxentities
|
||||
//maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH);
|
||||
maxentities = gi.cvar ("maxentities", va("%i",MAX_EDICTS), CVAR_LATCH);
|
||||
|
||||
// change anytime vars
|
||||
dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO);
|
||||
zdmflags = gi.cvar ("zdmflags", "0", CVAR_SERVERINFO);
|
||||
fraglimit = gi.cvar ("fraglimit", "0", CVAR_SERVERINFO);
|
||||
timelimit = gi.cvar ("timelimit", "0", CVAR_SERVERINFO);
|
||||
password = gi.cvar ("password", "", CVAR_USERINFO);
|
||||
//spectator_password = gi.cvar ("spectator_password", "", CVAR_USERINFO);
|
||||
//needpass = gi.cvar ("needpass", "0", CVAR_SERVERINFO);
|
||||
//filterban = gi.cvar ("filterban", "1", 0);
|
||||
|
||||
g_select_empty = gi.cvar ("g_select_empty", "0", CVAR_ARCHIVE);
|
||||
|
||||
|
@ -148,7 +160,13 @@ void InitGame (void)
|
|||
bob_pitch = gi.cvar ("bob_pitch", "0.002", 0);
|
||||
bob_roll = gi.cvar ("bob_roll", "0.002", 0);
|
||||
|
||||
gamedir = gi.cvar ("gamedir", "baseq2", CVAR_SERVERINFO);
|
||||
// flood control
|
||||
//flood_msgs = gi.cvar ("flood_msgs", "4", 0);
|
||||
//flood_persecond = gi.cvar ("flood_persecond", "4", 0);
|
||||
//flood_waitdelay = gi.cvar ("flood_waitdelay", "10", 0);
|
||||
|
||||
// dm map list
|
||||
//sv_maplist = gi.cvar ("sv_maplist", "", 0);
|
||||
|
||||
// items
|
||||
InitItems ();
|
||||
|
@ -167,9 +185,6 @@ void InitGame (void)
|
|||
game.maxclients = maxclients->value;
|
||||
game.clients = gi.TagMalloc (game.maxclients * sizeof(game.clients[0]), TAG_GAME);
|
||||
globals.num_edicts = game.maxclients+1;
|
||||
|
||||
// get at the gl_polyblend client variable
|
||||
gi.cvar("gl_polyblend", "1", CVAR_USERINFO);
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
@ -504,6 +519,7 @@ void WriteEdict (FILE *f, edict_t *ent)
|
|||
{
|
||||
WriteField2 (f, field, (byte *)ent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -665,7 +681,15 @@ void ReadLevel (const char *filename)
|
|||
|
||||
// check function pointer base address
|
||||
fread (&base, sizeof(base), 1, f);
|
||||
/*#ifdef _WIN32
|
||||
if (base != (void *)InitGame)
|
||||
{
|
||||
fclose (f);
|
||||
gi.error ("ReadLevel: function pointers have moved");
|
||||
}
|
||||
#else
|
||||
gi.dprintf("Function offsets %d\n", ((byte *)base) - ((byte *)InitGame));
|
||||
#endif*/
|
||||
|
||||
// load the level locals
|
||||
ReadLevelLocals (f);
|
||||
|
|
Loading…
Reference in a new issue