Navbot rewrite v1

This commit is contained in:
TotallyNotElite 2018-11-24 00:08:48 +01:00
parent 96453931f6
commit 1b90e31f81
4 changed files with 155 additions and 866 deletions

View File

@ -1,13 +1,16 @@
//
// Created by bencat07 on 17.08.18.
//
#pragma once
#include "common.hpp"
#include "config.h"
namespace hacks::tf2::NavBot
{
void Init();
void initonce();
extern Vector Best_Spot;
bool init(bool first_cm);
namespace task
{
enum task : u_int8_t
{
sniper_spot = 0,
stay_near = 0,
none
};
}
} // namespace hacks::tf2::NavBot

View File

@ -32,11 +32,27 @@ void SetCVarInterface(ICvar *iface);
#include <sstream>
#include <vector>
#include <mutex>
#include <random>
#include <core/sdk.hpp>
// typedef void ( *FnCommandCallback_t )( const CCommand &command );
template <typename Iter, typename RandomGenerator>
Iter select_randomly(Iter start, Iter end, RandomGenerator &g)
{
std::uniform_int_distribution<> dis(0, std::distance(start, end) - 1);
std::advance(start, dis(g));
return start;
}
template <typename Iter> Iter select_randomly(Iter start, Iter end)
{
static std::random_device rd;
static std::mt19937 gen(rd());
return select_randomly(start, end, gen);
}
// TODO split this shit
std::vector<ConVar *> &RegisteredVarsList();

File diff suppressed because it is too large Load Diff

View File

@ -304,7 +304,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
// hacks::tf2::NavBot::initonce();
nav::status = nav::off;
IRC::auth();
hacks::tf2::NavBot::initonce();
hacks::tf2::NavBot::init(true);
firstcm = false;
}
g_Settings.bInvalid = false;