mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-04-20 21:05:44 +00:00
New gsc func + premake5 update
This commit is contained in:
parent
12562eb8fd
commit
12fd44d0da
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -4,12 +4,6 @@
|
|||||||
[submodule "deps/GSL"]
|
[submodule "deps/GSL"]
|
||||||
path = deps/GSL
|
path = deps/GSL
|
||||||
url = https://github.com/microsoft/GSL.git
|
url = https://github.com/microsoft/GSL.git
|
||||||
[submodule "deps/sol2"]
|
|
||||||
path = deps/sol2
|
|
||||||
url = https://github.com/ThePhD/sol2.git
|
|
||||||
[submodule "deps/lua"]
|
|
||||||
path = deps/lua
|
|
||||||
url = https://github.com/lua/lua.git
|
|
||||||
[submodule "deps/json"]
|
[submodule "deps/json"]
|
||||||
path = deps/json
|
path = deps/json
|
||||||
url = https://github.com/nlohmann/json.git
|
url = https://github.com/nlohmann/json.git
|
||||||
|
21
premake5.lua
21
premake5.lua
@ -36,12 +36,19 @@ workspace "iw5-gsc-utils"
|
|||||||
targetdir "%{wks.location}/bin/%{cfg.buildcfg}"
|
targetdir "%{wks.location}/bin/%{cfg.buildcfg}"
|
||||||
targetname "%{prj.name}"
|
targetname "%{prj.name}"
|
||||||
|
|
||||||
|
configurations { "Debug", "Release", }
|
||||||
|
|
||||||
language "C++"
|
language "C++"
|
||||||
|
cppdialect "C++20"
|
||||||
|
|
||||||
architecture "x86"
|
architecture "x86"
|
||||||
|
|
||||||
buildoptions "/std:c++latest"
|
|
||||||
systemversion "latest"
|
systemversion "latest"
|
||||||
|
symbols "On"
|
||||||
|
staticruntime "On"
|
||||||
|
editandcontinue "Off"
|
||||||
|
warnings "Extra"
|
||||||
|
characterset "ASCII"
|
||||||
|
|
||||||
flags
|
flags
|
||||||
{
|
{
|
||||||
@ -49,19 +56,15 @@ workspace "iw5-gsc-utils"
|
|||||||
"MultiProcessorCompile",
|
"MultiProcessorCompile",
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations { "Debug", "Release", }
|
filter "configurations:Release"
|
||||||
|
|
||||||
symbols "On"
|
|
||||||
|
|
||||||
configuration "Release"
|
|
||||||
optimize "Full"
|
optimize "Full"
|
||||||
defines { "NDEBUG" }
|
defines { "NDEBUG" }
|
||||||
configuration{}
|
filter {}
|
||||||
|
|
||||||
configuration "Debug"
|
filter "configurations:Debug"
|
||||||
optimize "Debug"
|
optimize "Debug"
|
||||||
defines { "DEBUG", "_DEBUG" }
|
defines { "DEBUG", "_DEBUG" }
|
||||||
configuration {}
|
filter {}
|
||||||
|
|
||||||
startproject "iw5-gsc-utils"
|
startproject "iw5-gsc-utils"
|
||||||
|
|
||||||
|
@ -53,8 +53,6 @@ namespace gsc
|
|||||||
{
|
{
|
||||||
std::vector<scripting::script_value> args;
|
std::vector<scripting::script_value> args;
|
||||||
|
|
||||||
const auto top = game::scr_VmPub->top;
|
|
||||||
|
|
||||||
for (auto i = 0; i < game::scr_VmPub->outparamcount; i++)
|
for (auto i = 0; i < game::scr_VmPub->outparamcount; i++)
|
||||||
{
|
{
|
||||||
const auto value = game::scr_VmPub->top[-i];
|
const auto value = game::scr_VmPub->top[-i];
|
||||||
@ -380,7 +378,7 @@ namespace gsc
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
function::add("dropallbots", [](const function_args& args) -> scripting::script_value
|
function::add("dropallbots", [](const function_args&) -> scripting::script_value
|
||||||
{
|
{
|
||||||
for (auto i = 0; i < *game::svs_clientCount; i++)
|
for (auto i = 0; i < *game::svs_clientCount; i++)
|
||||||
{
|
{
|
||||||
@ -437,7 +435,7 @@ namespace gsc
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
method::add("isbot", [](const game::scr_entref_t ent, const function_args& args) -> scripting::script_value
|
method::add("isbot", [](const game::scr_entref_t ent, const function_args&) -> scripting::script_value
|
||||||
{
|
{
|
||||||
if (ent.classnum != 0)
|
if (ent.classnum != 0)
|
||||||
{
|
{
|
||||||
@ -454,6 +452,23 @@ namespace gsc
|
|||||||
return game::svs_clients[client].bIsTestClient;
|
return game::svs_clients[client].bIsTestClient;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
method::add("arecontrolsfrozen", [](const game::scr_entref_t ent, const function_args&) -> scripting::script_value
|
||||||
|
{
|
||||||
|
if (ent.classnum != 0)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Invalid entity");
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto client = ent.entnum;
|
||||||
|
|
||||||
|
if (game::g_entities[client].client == nullptr)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Not a player entity");
|
||||||
|
}
|
||||||
|
|
||||||
|
return {(game::g_entities[client].client->flags & 4) != 0};
|
||||||
|
});
|
||||||
|
|
||||||
utils::hook::jump(0x56C8EB, call_builtin_stub);
|
utils::hook::jump(0x56C8EB, call_builtin_stub);
|
||||||
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
|
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace userinfo
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
|
||||||
{
|
{
|
||||||
if (ent.classnum != 0)
|
if (ent.classnum != 0)
|
||||||
{
|
{
|
||||||
@ -150,7 +150,7 @@ namespace userinfo
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
|
||||||
{
|
{
|
||||||
if (ent.classnum != 0)
|
if (ent.classnum != 0)
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ namespace userinfo
|
|||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
gsc::method::add("removeclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
gsc::method::add("removeclantag", [](const game::scr_entref_t ent, const gsc::function_args&) -> scripting::script_value
|
||||||
{
|
{
|
||||||
if (ent.classnum != 0)
|
if (ent.classnum != 0)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <stdinc.hpp>
|
#include <stdinc.hpp>
|
||||||
#include "loader/component_loader.hpp"
|
#include "loader/component_loader.hpp"
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
|
||||||
{
|
{
|
||||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||||
{
|
{
|
||||||
|
@ -269,8 +269,6 @@ namespace scripting
|
|||||||
{
|
{
|
||||||
return get_custom_field(entity, field);
|
return get_custom_field(entity, field);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int make_array()
|
unsigned int make_array()
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user