mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
Game variable support
This commit is contained in:
parent
0c2596db3d
commit
2ae89359ce
@ -11,6 +11,8 @@
|
||||
|
||||
#include <utils/string.hpp>
|
||||
|
||||
namespace _game = game;
|
||||
|
||||
namespace scripting::lua
|
||||
{
|
||||
namespace
|
||||
@ -259,6 +261,19 @@ namespace scripting::lua
|
||||
{
|
||||
logfile::add_player_killed_callback(callback);
|
||||
};
|
||||
|
||||
game_type["getgamevar"] = [](const sol::this_state s)
|
||||
{
|
||||
const auto id = *reinterpret_cast<unsigned int*>(0x14815DEB4);
|
||||
|
||||
const auto value = _game::scr_VarGlob->childVariableValue[id];
|
||||
|
||||
_game::VariableValue variable{};
|
||||
variable.type = value.type;
|
||||
variable.u.uintValue = value.u.u.uintValue;
|
||||
|
||||
return convert(s, variable);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user