Update function tables + bots

This commit is contained in:
Federico Cecchetto 2022-03-04 20:46:09 +01:00
parent e5149fe721
commit 2261c68b5b
3 changed files with 638 additions and 641 deletions

View File

@ -7,6 +7,7 @@
#include "party.hpp"
#include "game/game.hpp"
#include "game/scripting/execution.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
@ -28,20 +29,16 @@ namespace bots
// TODO: when scripting comes, fix this to use better notifies
void bot_team_join(const int entity_num)
{
scheduler::once([entity_num]()
const game::scr_entref_t entref{static_cast<uint16_t>(entity_num), 0};
scheduler::once([entref]()
{
game::SV_ExecuteClientCommand(&game::mp::svs_clients[entity_num],
utils::string::va("lui 68 2 %i", *game::mp::sv_serverId_value),
false);
// scheduler the select class call
scheduler::once([entity_num]()
scripting::notify(entref, "luinotifyserver", {"team_select", 2});
scheduler::once([entref]()
{
game::SV_ExecuteClientCommand(&game::mp::svs_clients[entity_num],
utils::string::va("lui 5 %i %i", (rand() % 5) + 10,
*game::mp::sv_serverId_value), false);
}, scheduler::pipeline::server, 1s);
}, scheduler::pipeline::server, 1s);
auto* _class = utils::string::va("class%d", utils::cryptography::random::get_integer() % 5);
scripting::notify(entref, "luinotifyserver", {"class_select", _class});
}, scheduler::pipeline::server, 2s);
}, scheduler::pipeline::server, 2s);
}
void spawn_bot(const int entity_num)

View File

@ -35,7 +35,7 @@ namespace renderer
{
if (dvars::r_fullbright->modified)
{
game::Dvar_ClearModified(dvars::r_fullbright);
//game::Dvar_ClearModified(dvars::r_fullbright);
game::R_SyncRenderThread();
gfxdrawmethod();

File diff suppressed because it is too large Load Diff