update protobuf + small changes

changes by @diamante0018 from https://github.com/XLabsProject/s1x-client/pull/369
This commit is contained in:
mjkzy
2022-07-04 22:51:57 -05:00
parent 4ba78e9d34
commit 881e5ddbcb
12 changed files with 31 additions and 32 deletions

View File

@ -60,7 +60,7 @@ namespace bots
if (bot_ent)
{
spawn_bot(bot_ent->s.entityNum);
spawn_bot(bot_ent->s.number);
}
else
{

View File

@ -1,6 +1,10 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "game/game.hpp"
#include "game/dvars.hpp"
#include "game/scripting/execution.hpp"
#include "command.hpp"
#include "console.hpp"
#include "game_console.hpp"
@ -8,11 +12,6 @@
#include "scheduler.hpp"
#include "logfile.hpp"
#include "game/game.hpp"
#include "game/dvars.hpp"
#include "game/scripting/execution.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
#include <utils/memory.hpp>
@ -39,8 +38,14 @@ namespace command
}
}
void client_command(const int client_num)
void client_command(const char client_num)
{
if (game::mp::g_entities[client_num].client == nullptr)
{
// Client is not fully connected
return;
}
if (!logfile::client_command_stub(client_num))
{
return;
@ -539,9 +544,9 @@ namespace command
static void add_commands_generic()
{
add("quit", game::Quit);
add("crash", []()
add("crash", []
{
*reinterpret_cast<int*>(1) = 0;
*reinterpret_cast<int*>(1) = 0x12345678;
});
add("commandDump", [](const params& argument)

View File

@ -32,7 +32,7 @@ namespace logfile
return {};
}
const scripting::entity player{game::Scr_GetEntityId(ent->s.entityNum, 0)};
const scripting::entity player{game::Scr_GetEntityId(ent->s.number, 0)};
return scripting::lua::convert(state, player);
}
@ -262,7 +262,7 @@ namespace logfile
scheduler::once([cmd, message, self, hidden]()
{
const scripting::entity level{*game::levelEntityId};
const scripting::entity player{game::Scr_GetEntityId(self->s.entityNum, 0)};
const scripting::entity player{game::Scr_GetEntityId(self->s.number, 0)};
scripting::notify(level, cmd, {player, message, hidden});
scripting::notify(player, cmd, {message, hidden});

View File

@ -122,7 +122,7 @@ namespace patches
command::params_sv params{};
const auto menu_id = atoi(params.get(1));
const auto client = &svs_clients[ent->s.entityNum];
const auto client = &svs_clients[ent->s.number];
// 13 => change class
if (menu_id == 13 && ent->client->team == game::mp::TEAM_SPECTATOR)