Update function tables + bots

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff