aim: tweaked a bit grenade handling, so bots should use them more aim: reduce time between selecting grenade and throwing it away aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar aim: use direct enemy origin from visibility check, and not re-calculate it aim: update enemy prediction, so it now depends on frame interval for a bot aim: additional height offset are tweaked, and now used only for difficulty 4 nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain nav: do not check banned nodes, when bucket sizes re too low nav: cover nodes are now selected depending on total bots on server nav: let bot enter pause task after long jump nav: extend velocity by a little for a jump, like it was in first versions of bot nav: stuck checking is now taken in account lower minimal speed if bot is ducking fix: navigation reachability timers, so bots will have correct current node index while camping fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable fix: cover nodes are now calculated as they should fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard bot: minor refactoring and moving functions to correct source file bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight bot: camp buttons are now lightly depends on bot health chat: welcome chat message from bots is now sent during first freeze time period crlib: switch over to stdint.h and remove crlib-own types crlib: fixed alignment in sse code
119 lines
2.7 KiB
C++
119 lines
2.7 KiB
C++
/***
|
|
*
|
|
* Copyright (c) 1999-2005, Valve Corporation. All rights reserved.
|
|
*
|
|
* This product contains software technology licensed from Id
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This source code contains proprietary and confidential information of
|
|
* Valve LLC and its suppliers. Access to this code is restricted to
|
|
* persons who have executed a written SDK license with Valve. Any access,
|
|
* use or distribution of this code by or to any unlicensed person is illegal.
|
|
*
|
|
****/
|
|
|
|
#ifndef EXTDLL_H
|
|
#define EXTDLL_H
|
|
|
|
|
|
typedef int func_t; //
|
|
typedef float vec_t; // needed before including progdefs.h
|
|
typedef vec_t vec2_t[2];
|
|
typedef vec_t vec4_t[4];
|
|
typedef int qboolean;
|
|
typedef unsigned char byte;
|
|
|
|
#include <crlib/vector.h>
|
|
#include <crlib/string.h>
|
|
|
|
// idea from regamedll
|
|
class string_t final : public cr::DenyCopying {
|
|
private:
|
|
int offset;
|
|
|
|
public:
|
|
explicit string_t () : offset (0)
|
|
{ }
|
|
|
|
string_t (int offset) : offset (offset)
|
|
{ }
|
|
|
|
~string_t () = default;
|
|
|
|
public:
|
|
const char *chars (size_t shift = 0) const;
|
|
|
|
public:
|
|
operator int () const {
|
|
return offset;
|
|
}
|
|
|
|
string_t &operator = (const string_t &rhs) {
|
|
offset = rhs.offset;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
typedef cr::Vector vec3_t;
|
|
typedef struct edict_s edict_t;
|
|
|
|
#include "const.h"
|
|
#include "progdefs.h"
|
|
#include "model.h"
|
|
|
|
typedef struct link_s {
|
|
struct link_s *prev, *next;
|
|
} link_t;
|
|
|
|
typedef struct {
|
|
vec3_t normal;
|
|
float dist;
|
|
} plane_t;
|
|
|
|
struct edict_s {
|
|
int free;
|
|
int serialnumber;
|
|
link_t area; // linked to a division node or leaf
|
|
int headnode; // -1 to use normal leaf check
|
|
int num_leafs;
|
|
short leafnums[MAX_ENT_LEAFS];
|
|
float freetime; // sv.time when the object was freed
|
|
void *pvPrivateData; // Alloced and freed by engine, used by DLLs
|
|
entvars_t v; // C exported fields from progs
|
|
};
|
|
|
|
#include "eiface.h"
|
|
|
|
extern globalvars_t *globals;
|
|
extern enginefuncs_t engfuncs;
|
|
extern gamefuncs_t dllapi;
|
|
|
|
// Use this instead of ALLOC_STRING on constant strings
|
|
#define STRING(offset) (const char *)(globals->pStringBase + (int)offset)
|
|
|
|
// form fwgs-hlsdk
|
|
#if defined (CR_ARCH_X64)
|
|
static inline int MAKE_STRING (const char *val) {
|
|
long long ptrdiff = val - STRING (0);
|
|
|
|
if (ptrdiff > INT_MAX || ptrdiff < INT_MIN) {
|
|
return engfuncs.pfnAllocString (val);
|
|
}
|
|
return static_cast <int> (ptrdiff);
|
|
}
|
|
#else
|
|
#define MAKE_STRING(str) ((uint64_t)(str) - (uint64_t)(STRING(0)))
|
|
#endif
|
|
|
|
inline const char *string_t::chars (size_t shift) const {
|
|
auto result = STRING (offset);
|
|
|
|
return cr::strings.isEmpty (result) ? &cr::kNullChar : (result + shift);
|
|
}
|
|
|
|
enum HLBool : int32_t {
|
|
HLFalse, HLTrue
|
|
};
|
|
|
|
#endif // EXTDLL_H
|