Merge nq and qw sv_phys.c

sv_move and world are now identical between the two directories.
This commit is contained in:
Bill Currie 2011-12-22 13:42:39 +09:00
parent 2bec1ae1d9
commit 29306f7799
9 changed files with 24 additions and 15 deletions

View file

@ -35,6 +35,7 @@
#include "world.h"
//FIXME location
#define STOP_EPSILON 0.1
#define MAX_PHYSENTS (MAX_CLIENTS + MAX_PACKET_ENTITIES)

View file

@ -48,6 +48,7 @@ typedef struct
int maxclients;
int maxclientslimit;
struct client_s *clients; // [maxclients]
void (*phys_client) (struct edict_s *ent, int num);
int serverflags; // episode completion information
qboolean changelevel_issued; // cleared when at SV_SpawnServer
} server_static_t;
@ -234,6 +235,7 @@ extern client_t *host_client;
extern jmp_buf host_abortserver;
extern double host_time;
extern double sv_frametime;
extern edict_t *sv_player;
@ -294,6 +296,7 @@ void SV_Progs_Init_Cvars (void);
void Cvar_Info (struct cvar_s *var);
//FIXME location
#define STOP_EPSILON 0.1
extern struct clip_hull_s *pf_hull_list[];

View file

@ -584,7 +584,7 @@ Host_FilterTime (float time)
void
Host_ServerFrame (void)
{
*sv_globals.frametime = host_frametime;
*sv_globals.frametime = sv_frametime = host_frametime;
// set the time and clear the general datagram
SV_ClearDatagram ();

View file

@ -41,6 +41,7 @@ static __attribute__ ((used)) const char rcsid[] =
#define sv_frametime host_frametime
cvar_t *sv_nostep;
// CLIENT MOVEMENT ============================================================

View file

@ -46,6 +46,7 @@ static __attribute__ ((used)) const char rcsid[] =
server_t sv;
server_static_t svs;
double sv_frametime;
char localmodels[MAX_MODELS][5]; // inline model names for precache
@ -1106,6 +1107,7 @@ SV_SpawnServer (const char *server)
Sys_MaskPrintf (SYS_DEV, "SpawnServer: %s\n", server);
svs.changelevel_issued = false; // now safe to issue another
svs.phys_client = SV_Physics_Client;
// tell all connected clients that we are going to a new level
if (sv.active) {
@ -1217,7 +1219,7 @@ SV_SpawnServer (const char *server)
sv.state = ss_active;
// run two frames to allow everything to settle
host_frametime = 0.1;
sv_frametime = host_frametime = 0.1;
SV_Physics ();
sv.time += host_frametime;
SV_Physics ();

View file

@ -34,13 +34,10 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/sys.h"
#include "host.h"
#include "server.h"
#include "sv_progs.h"
#include "world.h"
#define sv_frametime host_frametime
/*
pushmove objects do not obey gravity, and do not interact with each
other or trigger fields, but block normal movement and push normal
@ -63,7 +60,6 @@ cvar_t *sv_friction;
cvar_t *sv_gravity;
cvar_t *sv_jump_any;
cvar_t *sv_maxvelocity;
cvar_t *sv_nostep;
cvar_t *sv_stopspeed;
#define MOVE_EPSILON 0.01
@ -852,7 +848,8 @@ SV_Physics (void)
}
if (i > 0 && i <= svs.maxclients) {
SV_Physics_Client (ent, i);
if (svs.phys_client)
svs.phys_client (ent, i);
continue;
}

View file

@ -293,6 +293,7 @@ typedef struct {
int maxclients;
int num_clients;
int serverflags; // episode completion information
void (*phys_client) (struct edict_s *ent, int num);
double last_heartbeat;
int heartbeat_sequence;
@ -650,4 +651,7 @@ extern int sv_nailmodel, sv_supernailmodel, sv_playermodel;
extern int con_printf_no_log;
//FIXME location
#define STOP_EPSILON 0.1
#endif // _SERVER_H

View file

@ -34,7 +34,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/sys.h"
#include "qw/pmove.h"
#include "server.h"
#include "sv_progs.h"
#include "world.h"
@ -57,17 +56,11 @@ static __attribute__ ((used)) const char rcsid[] =
solid_edge items clip against only bsp models.
*/
cvar_t *sv_accelerate;
cvar_t *sv_airaccelerate;
cvar_t *sv_friction;
cvar_t *sv_gravity;
cvar_t *sv_jump_any;
cvar_t *sv_maxspeed;
cvar_t *sv_maxvelocity;
cvar_t *sv_spectatormaxspeed;
cvar_t *sv_stopspeed;
cvar_t *sv_wateraccelerate;
cvar_t *sv_waterfriction;
#define MOVE_EPSILON 0.01
#if 0
@ -855,7 +848,8 @@ SV_Physics (void)
}
if (i > 0 && i <= svs.maxclients) {
// clients are run directly from packets
if (svs.phys_client)
svs.phys_client (ent, i);
continue;
}

View file

@ -82,6 +82,13 @@ edict_t *sv_player;
usercmd_t cmd;
cvar_t *sv_accelerate;
cvar_t *sv_airaccelerate;
cvar_t *sv_maxspeed;
cvar_t *sv_spectatormaxspeed;
cvar_t *sv_wateraccelerate;
cvar_t *sv_waterfriction;
cvar_t *sv_allowfake;
cvar_t *cl_rollspeed;