Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset tr_main because of a bug in new map #4

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@ Q3OBJ = \
$(B)/client/sv_main.o \
$(B)/client/sv_net_chan.o \
$(B)/client/sv_snapshot.o \
$(B)/client/sv_teleport.o \
$(B)/client/sv_world.o \
\
$(B)/client/q_math.o \
Expand Down Expand Up @@ -1432,6 +1433,7 @@ Q3DOBJ = \
$(B)/ded/sv_main.o \
$(B)/ded/sv_net_chan.o \
$(B)/ded/sv_snapshot.o \
$(B)/ded/sv_teleport.o \
$(B)/ded/sv_world.o \
\
$(B)/ded/cm_load.o \
Expand Down
5 changes: 5 additions & 0 deletions code/botlib/be_aas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "be_interface.h"
#include "be_aas_def.h"

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
aas_t aasWorlds[MAX_NUM_VMS];
int aasgvm = 0;
#else
aas_t aasworld;
#endif

libvar_t *saveroutingcache;

Expand Down
6 changes: 6 additions & 0 deletions code/botlib/be_aas_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#ifdef AASINTERN

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
extern int aasgvm;
extern aas_t aasWorlds[MAX_NUM_VMS];
#define aasworld aasWorlds[aasgvm]
#else
extern aas_t aasworld;
#endif

//AAS error message
void QDECL AAS_Error(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
Expand Down
4 changes: 4 additions & 0 deletions code/botlib/be_aas_move.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

extern botlib_import_t botimport;

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
aas_settings_t aassettingsWorlds[MAX_NUM_VMS];
#else
aas_settings_t aassettings;
#endif

//#define AAS_MOVE_DEBUG

Expand Down
5 changes: 5 additions & 0 deletions code/botlib/be_aas_move.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*****************************************************************************/

#ifdef AASINTERN
#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
extern aas_settings_t aassettingsWorlds[MAX_NUM_VMS];
#define aassettings aassettingsWorlds[aasgvm]
#else
extern aas_settings_t aassettings;
#endif
#endif //AASINTERN

//movement prediction
Expand Down
44 changes: 44 additions & 0 deletions code/botlib/be_aas_reach.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,49 @@ extern botlib_import_t botimport;
//area flag used for weapon jumping
#define AREA_WEAPONJUMP 8192 //valid area to weapon jump to
//number of reachabilities of each type
#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
int reach_swimWorlds[MAX_NUM_VMS]; //swim
#define reach_swim reach_swimWorlds[aasgvm]
int reach_equalfloorWorlds[MAX_NUM_VMS]; //walk on floors with equal height
#define reach_equalfloor reach_equalfloorWorlds[aasgvm]
int reach_stepWorlds[MAX_NUM_VMS]; //step up
#define reach_step reach_stepWorlds[aasgvm]
int reach_walkWorlds[MAX_NUM_VMS]; //walk of step
#define reach_walk reach_walkWorlds[aasgvm]
int reach_barrierWorlds[MAX_NUM_VMS]; //jump up to a barrier
#define reach_barrier reach_barrierWorlds[aasgvm]
int reach_waterjumpWorlds[MAX_NUM_VMS]; //jump out of water
#define reach_waterjump reach_waterjumpWorlds[aasgvm]
int reach_walkoffledgeWorlds[MAX_NUM_VMS]; //walk of a ledge
#define reach_walkoffledge reach_walkoffledgeWorlds[aasgvm]
int reach_jumpWorlds[MAX_NUM_VMS]; //jump
#define reach_jump reach_jumpWorlds[aasgvm]
int reach_ladderWorlds[MAX_NUM_VMS]; //climb or descent a ladder
#define reach_ladder reach_ladderWorlds[aasgvm]
int reach_teleportWorlds[MAX_NUM_VMS]; //teleport
#define reach_teleport reach_teleportWorlds[aasgvm]
int reach_elevatorWorlds[MAX_NUM_VMS]; //use an elevator
#define reach_elevator reach_elevatorWorlds[aasgvm]
int reach_funcbobWorlds[MAX_NUM_VMS]; //use a func bob
#define reach_funcbob reach_funcbobWorlds[aasgvm]
int reach_grappleWorlds[MAX_NUM_VMS]; //grapple hook
#define reach_grapple reach_grappleWorlds[aasgvm]
int reach_doublejumpWorlds[MAX_NUM_VMS]; //double jump
#define reach_doublejump reach_doublejumpWorlds[aasgvm]
int reach_rampjumpWorlds[MAX_NUM_VMS]; //ramp jump
#define reach_rampjump reach_rampjumpWorlds[aasgvm]
int reach_strafejumpWorlds[MAX_NUM_VMS]; //strafe jump (just normal jump but further)
#define reach_strafejump reach_strafejumpWorlds[aasgvm]
int reach_rocketjumpWorlds[MAX_NUM_VMS]; //rocket jump
#define reach_rocketjump reach_rocketjumpWorlds[aasgvm]
int reach_bfgjumpWorlds[MAX_NUM_VMS]; //bfg jump
#define reach_bfgjump reach_bfgjumpWorlds[aasgvm]
int reach_jumppadWorlds[MAX_NUM_VMS]; //jump pads
#define reach_jumppad reach_jumppadWorlds[aasgvm]
//if true grapple reachabilities are skipped
int calcgrapplereachWorlds[MAX_NUM_VMS];
#define calcgrapplereach calcgrapplereachWorlds[aasgvm]
#else
static int reach_swim; //swim
static int reach_equalfloor; //walk on floors with equal height
static int reach_step; //step up
Expand All @@ -85,6 +128,7 @@ static int reach_rocketjump; //rocket jump
static int reach_jumppad; //jump pads
//if true grapple reachabilities are skipped
int calcgrapplereach;
#endif
//linked reachability
typedef struct aas_lreachability_s
{
Expand Down
9 changes: 9 additions & 0 deletions code/botlib/be_aas_routealt.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,18 @@ typedef struct midrangearea_s
unsigned short goaltime;
} midrangearea_t;

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
midrangearea_t *midrangeareasWorlds[MAX_NUM_VMS];
#define midrangeareas midrangeareasWorlds[aasgvm]
int *clusterareasWorlds[MAX_NUM_VMS];
#define clusterareas clusterareasWorlds[aasgvm]
int numclusterareasWorlds[MAX_NUM_VMS];
#define numclusterareas numclusterareasWorlds[aasgvm]
#else
static midrangearea_t *midrangeareas;
static int *clusterareas;
static int numclusterareas;
#endif

//===========================================================================
//
Expand Down
6 changes: 6 additions & 0 deletions code/botlib/be_aas_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ typedef struct aas_tracestack_s
int nodenum; //node found after splitting with planenum
} aas_tracestack_t;


#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
int numaaslinksWorlds[MAX_NUM_VMS];
#define numaaslinks numaaslinksWorlds[aasgvm]
#else
static int numaaslinks;
#endif

//===========================================================================
//
Expand Down
31 changes: 31 additions & 0 deletions code/botlib/be_ai_goal.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,36 @@ typedef struct bot_goalstate_s
float avoidgoaltimes[MAX_AVOIDGOALS]; //times to avoid the goals
} bot_goalstate_t;

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
bot_goalstate_t *botgoalstatesWorlds[MAX_NUM_VMS][MAX_CLIENTS + 1]; // FIXME: init?
#define botgoalstates botgoalstatesWorlds[aasgvm]
itemconfig_t *itemconfigWorlds[MAX_NUM_VMS];
#define itemconfig itemconfigWorlds[aasgvm]
levelitem_t *levelitemheapWorlds[MAX_NUM_VMS];
#define levelitemheap levelitemheapWorlds[aasgvm]
levelitem_t *freelevelitemsWorlds[MAX_NUM_VMS];
#define freelevelitems freelevelitemsWorlds[aasgvm]
levelitem_t *levelitemsWorlds[MAX_NUM_VMS];
#define levelitems levelitemsWorlds[aasgvm]
int numlevelitemsWorlds[MAX_NUM_VMS];
#define numlevelitems numlevelitemsWorlds[aasgvm]
levelitem_t *spawnheapWorlds[MAX_NUM_VMS];
#define spawnheap spawnheapWorlds[aasgvm]
levelitem_t *freespawnsWorlds[MAX_NUM_VMS];
#define freespawns freespawnsWorlds[aasgvm]
levelitem_t *spawnsWorlds[MAX_NUM_VMS];
#define aispawns spawnsWorlds[aasgvm]
int numspawnsWorlds[MAX_NUM_VMS];
#define numspawns numspawnsWorlds[aasgvm]
maplocation_t *maplocationsWorlds[MAX_NUM_VMS];
#define maplocations maplocationsWorlds[aasgvm]
campspot_t *campspotsWorlds[MAX_NUM_VMS];
#define campspots campspotsWorlds[aasgvm]
int g_gametypeWorlds[MAX_NUM_VMS];
#define g_gametype g_gametypeWorlds[aasgvm]
libvar_t *droppedweightWorlds[MAX_NUM_VMS];
#define droppedweight droppedweightWorlds[aasgvm]
#else
static bot_goalstate_t *botgoalstates[MAX_CLIENTS + 1]; // FIXME: init?
//item configuration
static itemconfig_t *itemconfig = NULL;
Expand All @@ -200,6 +230,7 @@ static campspot_t *campspots = NULL;
static int g_gametype = 0;
//additional dropped item weight
static libvar_t *droppedweight = NULL;
#endif

//========================================================================
//
Expand Down
5 changes: 5 additions & 0 deletions code/botlib/be_ai_move.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ static libvar_t *cmd_grappleon;
//type of model, func_plat or func_bobbing
static int modeltypes[MAX_MODELS];

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
bot_movestate_t *botmovestatesWorlds[MAX_NUM_VMS][MAX_CLIENTS+1];
#define botmovestates botmovestatesWorlds[aasgvm]
#else
static bot_movestate_t *botmovestates[MAX_CLIENTS+1];
#endif

//========================================================================
//
Expand Down
7 changes: 7 additions & 0 deletions code/botlib/be_ai_weap.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,15 @@ typedef struct bot_weaponstate_s
int *weaponweightindex; //weapon weight index
} bot_weaponstate_t;

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
static bot_weaponstate_t *botweaponstatesWorlds[MAX_NUM_VMS][MAX_CLIENTS+1];
#define botweaponstates botweaponstatesWorlds[aasgvm]
static weaponconfig_t *weaponconfigWorlds[MAX_NUM_VMS];
#define weaponconfig weaponconfigWorlds[aasgvm]
#else
static bot_weaponstate_t *botweaponstates[MAX_CLIENTS+1];
static weaponconfig_t *weaponconfig;
#endif

//========================================================================
//
Expand Down
5 changes: 5 additions & 0 deletions code/botlib/be_ea.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MAX_USERMOVE 400
#define MAX_COMMANDARGUMENTS 10

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
bot_input_t *botinputsWorlds[MAX_NUM_VMS];
#define botinputs botinputsWorlds[aasgvm]
#else
static bot_input_t *botinputs;
#endif

//===========================================================================
//
Expand Down
7 changes: 7 additions & 0 deletions code/botlib/be_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,3 +872,10 @@ botlib_export_t *GetBotLibAPI(int apiVersion, botlib_import_t *import) {

return &be_botlib_export;
}


#ifdef USE_MULTIVM_SERVER
void SetAASgvm(int gvm) {
aasgvm = gvm;
}
#endif
7 changes: 7 additions & 0 deletions code/botlib/botlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/

#if defined(USE_MULTIVM_CLIENT) || defined(USE_MULTIVM_SERVER)
extern int aasgvm;
#endif

#define BOTLIB_API_VERSION 2

struct aas_clientmove_s;
Expand Down Expand Up @@ -430,6 +434,9 @@ typedef struct botlib_export_s
int (*BotLibUpdateEntity)(int ent, bot_entitystate_t *state);
//just for testing
int (*Test)(int parm0, char *parm1, vec3_t parm2, vec3_t parm3);
#ifdef USE_MULTIVM_SERVER
void (*SetAASgvm)(int gvmi);
#endif
} botlib_export_t;

//linking of bot library
Expand Down
3 changes: 3 additions & 0 deletions code/cgame/cg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ typedef enum {
CG_R_ADDLINEARLIGHTTOSCENE,
CG_IS_RECORDING_DEMO,
CG_R_ADDPOLYBUFFERTOSCENE,
#if defined(USE_MULTIVM_RENDERER) || defined(USE_MULTIVM_SERVER)
CG_R_SWITCHWORLD,
#endif

#ifdef __WASM__
CG_GETASYNCFILES,
Expand Down
Loading
Loading