Skip to content

Commit 8ced237

Browse files
authored
Add files via upload
1 parent 08ca3ce commit 8ced237

File tree

4 files changed

+430
-18
lines changed

4 files changed

+430
-18
lines changed

include/core.h

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,17 @@ const int Const_MaxWaypoints = 2048;
461461
const int Const_MaxWeapons = 32;
462462
const int Const_NumWeapons = 26;
463463

464-
const bool AntiBlock = false;
464+
// A* Stuff
465+
enum class State { Open, Closed, New };
466+
467+
struct AStar_t
468+
{
469+
float g;
470+
float f;
471+
int parent;
472+
473+
State state;
474+
};
465475

466476
// weapon masks
467477
const int WeaponBits_Primary = ((1 << WEAPON_XM1014) | (1 << WEAPON_M3) | (1 << WEAPON_MAC10) | (1 << WEAPON_UMP45) | (1 << WEAPON_MP5) | (1 << WEAPON_TMP) | (1 << WEAPON_P90) | (1 << WEAPON_AUG) | (1 << WEAPON_M4A1) | (1 << WEAPON_SG552) | (1 << WEAPON_AK47) | (1 << WEAPON_SCOUT) | (1 << WEAPON_SG550) | (1 << WEAPON_AWP) | (1 << WEAPON_G3SG1) | (1 << WEAPON_M249) | (1 << WEAPON_FAMAS) | (1 << WEAPON_GALIL));
@@ -590,7 +600,7 @@ struct MenuText
590600
};
591601

592602
// array of clients struct
593-
struct Client_old
603+
struct Clients
594604
{
595605
MenuText* menu; // pointer to opened bot menu
596606
edict_t* ent; // pointer to actual edict
@@ -600,6 +610,8 @@ struct Client_old
600610
int flags; // client flags
601611
float hearingDistance; // distance this sound is heared
602612
float timeSoundLasting; // time sound is played/heared
613+
int ping; // when bot latency is enabled, client ping stored here
614+
bool pingUpdate; // update ping if true
603615

604616
int wpIndex;
605617
int wpIndex2;
@@ -700,9 +712,9 @@ class Bot
700712
bool m_isLeader; // bot is leader of his team
701713
bool m_checkTerrain; // check for terrain
702714
bool m_moveToC4; // ct is moving to bomb
703-
715+
704716
bool m_checkFall; // check bot fall
705-
Vector m_checkFallPoint[2];
717+
Vector m_checkFallPoint[2]; // idk why...
706718
float m_prevTime; // time previously checked movement speed
707719
float m_prevSpeed; // speed some frames before
708720
Vector m_prevOrigin; // origin some frames before
@@ -729,8 +741,7 @@ class Bot
729741
float m_knifeAttackTime; // time to rush with knife (at the beginning of the round)
730742
bool m_defendedBomb; // defend action issued
731743

732-
float m_damageTime;
733-
744+
float m_damageTime; // tweak for zombie bots
734745
float m_askCheckTime; // time to ask team
735746
float m_collideTime; // time last collision
736747
float m_firstCollideTime; // time of first collision
@@ -776,15 +787,15 @@ class Bot
776787
edict_t* m_targetEntity; // the entity that the bot is trying to reach
777788
edict_t* m_hostages[Const_MaxHostages]; // pointer to used hostage entities
778789

779-
Vector m_moveTargetOrigin;
790+
Vector m_moveTargetOrigin; // ...
780791

781792
bool m_isStuck; // bot is stuck
782793
bool m_isReloading; // bot is reloading a gun
783794
int m_reloadState; // current reload state
784795
int m_voicePitch; // bot voice pitch
785796
bool m_isZombieBot; // checks bot if zombie
786797
bool m_isBomber; // checks bot has C4
787-
int m_team; // team
798+
int m_team; // team OOOOOOOOOOHHHHHHHHHHH!!!!!!!!!!!!!
788799

789800
bool m_duckDefuse; // should or not bot duck to defuse bomb
790801
float m_duckDefuseCheckTime; // time to check for ducking for defuse
@@ -793,7 +804,7 @@ class Bot
793804

794805
int m_msecBuiltin; // random msec method for this bot
795806
//uint8_t m_msecVal; // calculated msec value
796-
float m_msecVal;
807+
float m_msecVal; // same
797808
float m_msecDel; // used for msec calculation
798809
float m_msecNum; // also used for mseccalculation
799810
float m_msecInterval; // used for leon hartwig's method for msec calculation
@@ -840,11 +851,11 @@ class Bot
840851
float m_randomizeAnglesTime; // time last randomized location
841852
float m_playerTargetTime; // time last targeting
842853

843-
float m_checkCampPointTime;
844-
int m_zhCampPointIndex;
854+
float m_checkCampPointTime; // zombie stuff
855+
int m_zhCampPointIndex; // zombie stuff index
845856

846-
Vector m_moveAnglesForRunMove;
847-
float m_moveSpeedForRunMove, m_strafeSpeedForRunMove;
857+
Vector m_moveAnglesForRunMove; // angles while running
858+
float m_moveSpeedForRunMove, m_strafeSpeedForRunMove; // for run
848859

849860
void SwitchChatterIcon(bool show);
850861
void BotAI(void);
@@ -998,6 +1009,7 @@ class Bot
9981009

9991010
public:
10001011
entvars_t* pev;
1012+
AStar_t waypoints[Const_MaxWaypoints];
10011013

10021014
// SyPB Pro P.30 - AMXX API
10031015
edict_t* m_enemyAPI;
@@ -1018,6 +1030,8 @@ class Bot
10181030

10191031
int m_wantedTeam; // player team bot wants select
10201032
int m_wantedClass; // player model bot wants to select
1033+
int m_difficulty; // bot difficulty
1034+
int m_basePingLevel; // base ping level for randomizing
10211035

10221036
int m_skill; // bots play skill
10231037
int m_moneyAmount; // amount of money in bot's bank
@@ -1096,8 +1110,8 @@ class Bot
10961110
float m_enemyReachableTimer; // time to recheck if Enemy reachable
10971111
bool m_isEnemyReachable; // direct line to enemy
10981112

1099-
edict_t* m_moveTargetEntity;
1100-
float m_blockCheckEnemyTime;
1113+
edict_t* m_moveTargetEntity; // target entity for move
1114+
float m_blockCheckEnemyTime; // block time for entity check (useless)
11011115

11021116
float m_seeEnemyTime; // time bot sees enemy
11031117
float m_enemySurpriseTime; // time of surprise
@@ -1189,7 +1203,7 @@ class Bot
11891203
void PushTask(BotTask taskID, float desire, int data, float time, bool canContinue);
11901204
void DiscardWeaponForUser(edict_t* user, bool discardC4);
11911205

1192-
void ChatSay(bool teamSay, const char* text);
1206+
void ChatSay(bool teamSay, const char* text, ...);
11931207

11941208
void ChatMessage(int type, bool isTeamSay = false);
11951209
void RadioMessage(int message);
@@ -1454,7 +1468,6 @@ class Waypoint : public Singleton <Waypoint>
14541468
Vector GetBombPosition(void) { return m_foundBombOrigin; }
14551469
void SetBombPosition(bool shouldReset = false);
14561470
String CheckSubfolderFile(void);
1457-
String CheckSubfolderFileOld(void);
14581471

14591472
int* GetWaypointPath() { return m_pathMatrix; }
14601473
int* GetWaypointDist() { return m_distMatrix; }

include/engine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3394,6 +3394,8 @@ class Engine : public Singleton <Engine>
33943394

33953395
float Max(float one, float two);
33963396

3397+
int MinInt(int one, int two);
3398+
33973399
float Sine(float X);
33983400

33993401
float Clamp(float a, float b, float c);

0 commit comments

Comments
 (0)