fixed crashes on door open on xash3d
workaround bug with svc_bad after adding bots reworked a little how bot menus works some more source cleanup
This commit is contained in:
parent
81a4b54205
commit
0f97db33db
11 changed files with 304 additions and 257 deletions
|
|
@ -66,6 +66,34 @@ enum GameFlags
|
|||
GAME_METAMOD = (1 << 6)
|
||||
};
|
||||
|
||||
// bot menu ids
|
||||
enum MenuId
|
||||
{
|
||||
BOT_MENU_IVALID = -1,
|
||||
BOT_MENU_MAIN,
|
||||
BOT_MENU_FEATURES,
|
||||
BOT_MENU_CONTROL,
|
||||
BOT_MENU_WEAPON_MODE,
|
||||
BOT_MENU_PERSONALITY,
|
||||
BOT_MENU_DIFFICULTY,
|
||||
BOT_MENU_TEAM_SELECT,
|
||||
BOT_MENU_TERRORIST_SELECT,
|
||||
BOT_MENU_CT_SELECT,
|
||||
BOT_MENU_COMMANDS,
|
||||
BOT_MENU_WAYPOINT_MAIN_PAGE1,
|
||||
BOT_MENU_WAYPOINT_MAIN_PAGE2,
|
||||
BOT_MENU_WAYPOINT_RADIUS,
|
||||
BOT_MENU_WAYPOINT_TYPE,
|
||||
BOT_MENU_WAYPOINT_FLAG,
|
||||
BOT_MENU_WAYPOINT_AUTOPATH,
|
||||
BOT_MENU_WAYPOINT_PATH,
|
||||
BOT_MENU_KICK_PAGE_1,
|
||||
BOT_MENU_KICK_PAGE_2,
|
||||
BOT_MENU_KICK_PAGE_3,
|
||||
BOT_MENU_KICK_PAGE_4,
|
||||
BOT_MENU_TOTAL_MENUS
|
||||
};
|
||||
|
||||
// log levels
|
||||
enum LogLevel
|
||||
{
|
||||
|
|
@ -601,14 +629,15 @@ struct WeaponSelect
|
|||
// struct for menus
|
||||
struct MenuText
|
||||
{
|
||||
int validSlots; // ored together bits for valid keys
|
||||
const char *menuText; // ptr to actual string
|
||||
MenuId id; // actual menu id
|
||||
int slots; // together bits for valid keys
|
||||
String text; // ptr to actual string
|
||||
};
|
||||
|
||||
// array of clients struct
|
||||
struct Client
|
||||
{
|
||||
MenuText *menu; // pointer to opened bot menu
|
||||
MenuId menu; // id to opened bot menu
|
||||
edict_t *ent; // pointer to actual edict
|
||||
Vector origin; // position in the world
|
||||
Vector soundPosition; // position sound was played
|
||||
|
|
@ -619,6 +648,8 @@ struct Client
|
|||
|
||||
float hearingDistance; // distance this sound is heared
|
||||
float timeSoundLasting; // time sound is played/heared
|
||||
|
||||
Client (void) : menu (BOT_MENU_IVALID) { }
|
||||
};
|
||||
|
||||
// experience data hold in memory while playing
|
||||
|
|
@ -1184,7 +1215,7 @@ public:
|
|||
bool FindWaypoint (void);
|
||||
bool EntityIsVisible (const Vector &dest, bool fromBody = false);
|
||||
|
||||
void SwitchChatterIcon (bool show);
|
||||
void EnableChatterIcon (bool show);
|
||||
void DeleteSearchNodes (void);
|
||||
void VerifyBreakable (edict_t *touch);
|
||||
|
||||
|
|
@ -1455,6 +1486,11 @@ public:
|
|||
WaypointDownloadError RequestWaypoint (void);
|
||||
};
|
||||
|
||||
class BotMenu
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
#include <engine.h>
|
||||
|
||||
// expose bot super-globals
|
||||
|
|
@ -1482,7 +1518,7 @@ extern void FreeLibraryMemory (void);
|
|||
extern void RoundInit (void);
|
||||
extern void CheckWelcomeMessage (void);
|
||||
extern void AddLogEntry (bool outputToConsole, int logLevel, const char *format, ...);
|
||||
extern void DisplayMenuToClient (edict_t *ent, MenuText *menu);
|
||||
extern void DisplayMenuToClient (edict_t *ent, MenuId menu);
|
||||
extern void DecalTrace (entvars_t *pev, TraceResult *trace, int logotypeIndex);
|
||||
extern void SoundAttachToClients (edict_t *ent, const char *sample, float volume);
|
||||
extern void SoundSimulateUpdate (int playerIndex);
|
||||
|
|
|
|||
|
|
@ -2429,7 +2429,7 @@ public:
|
|||
// Returns:
|
||||
// Length of string, 0 in case of error.
|
||||
//
|
||||
int GetLength (void)
|
||||
int GetLength (void) const
|
||||
{
|
||||
if (m_bufferPtr == NULL)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extern bool g_waypointOn;
|
|||
extern bool g_autoWaypoint;
|
||||
extern bool g_botsCanPause;
|
||||
extern bool g_editNoclip;
|
||||
extern bool g_isCommencing;
|
||||
extern bool g_gameWelcomeSent;
|
||||
|
||||
extern float g_autoPathDistance;
|
||||
extern float g_timeBombPlanted;
|
||||
|
|
@ -57,7 +57,7 @@ extern WeaponSelect g_weaponSelect[NUM_WEAPONS + 1];
|
|||
extern WeaponProperty g_weaponDefs[MAX_WEAPONS + 1];
|
||||
|
||||
extern Client g_clients[MAX_ENGINE_PLAYERS];
|
||||
extern MenuText g_menus[21];
|
||||
extern MenuText g_menus[BOT_MENU_TOTAL_MENUS];
|
||||
extern TaskItem g_taskFilters[];
|
||||
|
||||
extern Experience *g_experienceData;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue