Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
EfeDursun125 committed Aug 9, 2022
1 parent 286debd commit b2f93a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 39 deletions.
27 changes: 2 additions & 25 deletions include/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@
#ifndef EBOT_INCLUDED
#define EBOT_INCLUDED

#ifdef _WIN32
#define cpuid(info, x) __cpuidex(info, x, 0)
#else
#include <cpuid.h>
void cpuid(int info[4], int InfoType) {
__cpuid_count(InfoType, 0, info[0], info[1], info[2], info[3]);
}
#endif

#include <stdio.h>
#include <memory.h>
#include <xmmintrin.h>
Expand Down Expand Up @@ -763,7 +754,6 @@ class Bot

PathNode* m_navNode; // pointer to current node from path
PathNode* m_navNodeStart; // pointer to start of path finding nodes
uint8_t m_pathType; // which pathfinder to use
uint8_t m_visibility; // visibility flags

int m_currentWaypointIndex; // current waypoint index
Expand Down Expand Up @@ -850,14 +840,6 @@ class Bot

Vector m_moveAngles; // bot move angles
bool m_moveToGoal; // bot currently moving to goal??

Vector m_idealAngles; // angle wanted
Vector m_randomizedIdealAngles; // angle wanted with noise
Vector m_angularDeviation; // angular deviation from current to ideal angles
Vector m_aimSpeed; // aim speed calculated
Vector m_targetOriginAngularSpeed; // target/enemy angular speed

float m_randomizeAnglesTime; // time last randomized location
float m_playerTargetTime; // time last targeting

float m_checkCampPointTime; // zombie stuff
Expand Down Expand Up @@ -926,7 +908,6 @@ class Bot

void GetCampDirection(Vector* dest);
int GetMessageQueue(void);
int FindGoalPost(int tactic, Array <int> defensive, Array <int> offsensive);
void FilterGoals(const Array <int>& goals, int* result);
bool GoalIsValid(void);
bool HeadTowardWaypoint(void);
Expand Down Expand Up @@ -1013,7 +994,7 @@ class Bot
int GetCampAimingWaypoint(void);
int GetAimingWaypoint(Vector targetOriginPos);
void FindShortestPath(int srcIndex, int destIndex);
void FindPath(int srcIndex, int destIndex, uint8_t pathType = 0);
void FindPath(int srcIndex, int destIndex);
void SecondThink(void);

public:
Expand Down Expand Up @@ -1132,8 +1113,6 @@ class Bot
int m_checkEnemyNum;
float m_lookYawVel;
float m_lookPitchVel;
float m_aimstoptime;
float m_aimstopdelay;

int m_numFriendsLeft;
int m_numEnemiesLeft;
Expand Down Expand Up @@ -1487,15 +1466,14 @@ extern void SubtractVectors(Vector first, Vector second, Vector output);
extern float GetVectorDotProduct(Vector first, Vector second);
extern float Sine(float X);
extern float AngleDiff(float destAngle, float srcAngle);
extern float Clamp(float a, float b, float c);

extern void SetGameMod(int gamemode);
extern bool IsZombieMode(void);
extern bool IsDeathmatchMode(void);
extern bool IsValidWaypoint(int index);
extern bool ChanceOf(int number);
extern float Q_rsqrt(float number);
extern float sse_rsqrt(float number);
extern float Clamp(float a, float b, float c);

extern int GetEntityWaypoint(edict_t* ent);
extern int SetEntityWaypoint(edict_t* ent, int mode = -1);
Expand Down Expand Up @@ -1537,7 +1515,6 @@ extern void FakeClientCommand(edict_t* fakeClient, const char* format, ...);
extern void strtrim(char* string);
extern void CreatePath(char* path);
extern void ServerCommand(const char* format, ...);
extern void RegisterBotVariable(int variableID, const char* initialValue, int flags = FCVAR_EXTDLL | FCVAR_SERVER);
extern void RegisterCommand(char* command, void funcPtr(void));
extern void CheckWelcomeMessage(void);
extern void DetectCSVersion(void);
Expand Down
2 changes: 1 addition & 1 deletion include/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3384,7 +3384,7 @@ class Engine : public Singleton <Engine>

float Sine(float X);

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

// sends bot command
void IssueBotCommand(edict_t* ent, const char* fmt, ...);
Expand Down
3 changes: 2 additions & 1 deletion include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifndef GLOBALS_INCLUDED
#define GLOBALS_INCLUDED

extern bool cpuSSESuport;

extern float API_Version;
extern float amxxDLL_Version;
extern uint16 amxxDLL_bV16[4];
Expand Down Expand Up @@ -70,7 +72,6 @@ extern unsigned short g_killHistory;
extern int g_normalWeaponPrefs[Const_NumWeapons];
extern int g_rusherWeaponPrefs[Const_NumWeapons];
extern int g_carefulWeaponPrefs[Const_NumWeapons];
extern int g_grenadeBuyPrecent[Const_NumWeapons - 23];
extern int g_grenadeBuyMoney[Const_NumWeapons - 23];
extern int g_radioSelect[32];
extern int g_lastRadio[2];
Expand Down
18 changes: 6 additions & 12 deletions include/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,20 +560,17 @@ class Vector
//
inline float GetLength(void) const
{
float pOut;
float number = x * x + y * y + z * z;
__m128 in = _mm_load_ss(&number);
_mm_store_ss(&pOut, _mm_rsqrt_ss(in));
/*long i;
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = *(long*)&y;
i = 0x5f3759df - (i >> 1);
y = *(float*)&i;
y = y * (threehalfs - (x2 * y * y));*/
return pOut * number;
y = y * (threehalfs - (x2 * y * y));
return y * number;
}

//
Expand All @@ -590,19 +587,16 @@ class Vector
inline float GetLength2D(void) const
{
float number = x * x + y * y;
float pOut;
__m128 in = _mm_load_ss(&number);
_mm_store_ss(&pOut, _mm_rsqrt_ss(in));
/*long i;
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = *(long*)&y;
i = 0x5f3759df - (i >> 1);
y = *(float*)&i;
y = y * (threehalfs - (x2 * y * y));*/
return pOut * number;
y = y * (threehalfs - (x2 * y * y));
return y * number;
}

//
Expand Down

0 comments on commit b2f93a7

Please sign in to comment.