Small fixes and additions

This commit is contained in:
momo5502 2021-04-21 18:42:45 +02:00
parent 710dd2c6ba
commit d496ff182b
6 changed files with 19 additions and 3 deletions

View File

@ -307,6 +307,11 @@ namespace party
}
});
command::add("reconnect", [](const command::params& argument)
{
connect(connect_state.host);
});
command::add("connect", [](const command::params& argument)
{
if (argument.size() != 2)

View File

@ -158,6 +158,10 @@ namespace patches
}
else
{
scheduler::once([]()
{
command::execute("reconnect");
}, scheduler::pipeline::main, 1s);
game::Com_Error(game::ERR_DROP, error, arg1);
}
}
@ -286,7 +290,7 @@ namespace patches
// some anti tamper thing that kills performance
dvars::override::Dvar_RegisterInt("dvl", 0, 0, 0, game::DVAR_FLAG_NONE);
// unlock safeArea_*
utils::hook::jump(0x140219F5E, 0x140219F67);
utils::hook::jump(0x140219F80, 0x140219F8E);

View File

@ -26,6 +26,11 @@ namespace scripting
this->add();
}
entity::entity(game::scr_entref_t entref)
: entity(game::FindEntityId(entref.entnum, entref.classnum))
{
}
entity::~entity()
{
this->release();

View File

@ -9,6 +9,7 @@ namespace scripting
public:
entity();
entity(unsigned int entity_id);
entity(game::scr_entref_t entref);
entity(const entity& other);
entity(entity&& other) noexcept;

View File

@ -115,7 +115,7 @@ namespace scripting
script_value get_custom_field(const entity& entity, const std::string& field)
{
auto fields = custom_fields[entity.get_entity_id()];
auto& fields = custom_fields[entity.get_entity_id()];
const auto _field = fields.find(field);
if (_field != fields.end())
{

View File

@ -94,7 +94,8 @@ namespace game
WEAK symbol<void(void* buffer)> FS_FreeFile{0x140362380, 0x1404AF370};
WEAK symbol<void()> GScr_LoadConsts{0x140283970, 0x1403479C0};
WEAK symbol<unsigned int(unsigned int parentId, unsigned int name)> FindVariable{0x1403166D0, 0x1403F2DC0};
WEAK symbol<unsigned int(unsigned int parentId, unsigned int name)> FindVariable{0x1403165D0, 0x1403F2DC0};
WEAK symbol<unsigned int(int entnum, unsigned int classnum)> FindEntityId{0x1403166D0, 0x1403F2CC0};
WEAK symbol<scr_string_t(unsigned int parentId, unsigned int id)> GetVariableName{0x1403170E0, 0x1403F37F0};
WEAK symbol<void(VariableValue* result, unsigned int classnum, int entnum, int offset)> GetEntityFieldValue{
0x14031AAD0, 0x1403F72A0