Refactor sp commands
This commit is contained in:
parent
52d0326562
commit
b14d21d9a1
@ -122,6 +122,8 @@ namespace game
|
||||
|
||||
namespace sp
|
||||
{
|
||||
sp::IsServerRunning_t IsServerRunning;
|
||||
|
||||
sp::gentity_s* g_entities;
|
||||
}
|
||||
|
||||
@ -732,6 +734,8 @@ namespace game
|
||||
|
||||
native::Sys_IsServerThread = native::Sys_IsServerThread_t(SELECT_VALUE(0x4CC5A0, 0x55F9A0, 0x0));
|
||||
|
||||
native::sp::IsServerRunning = native::sp::IsServerRunning_t(0x45D310);
|
||||
|
||||
native::XUIDToString = native::XUIDToString_t(SELECT_VALUE(0x4FAA30, 0x55CC20, 0x0));
|
||||
|
||||
native::SEH_LocalizeTextMessage = native::SEH_LocalizeTextMessage_t(
|
||||
|
@ -184,6 +184,9 @@ namespace game
|
||||
|
||||
namespace sp
|
||||
{
|
||||
typedef bool (*IsServerRunning_t)();
|
||||
extern IsServerRunning_t IsServerRunning;
|
||||
|
||||
extern sp::gentity_s* g_entities;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void command::add_sp_commands()
|
||||
{
|
||||
add("noclip", []()
|
||||
{
|
||||
if (!game::native::Dvar_FindVar("sv_running")->current.enabled)
|
||||
if (!game::native::sp::IsServerRunning())
|
||||
return;
|
||||
|
||||
const auto* ent = &game::native::sp::g_entities[0];
|
||||
@ -253,7 +253,7 @@ void command::add_sp_commands()
|
||||
|
||||
add("ufo", []()
|
||||
{
|
||||
if (!game::native::Dvar_FindVar("sv_running")->current.enabled)
|
||||
if (!game::native::sp::IsServerRunning())
|
||||
return;
|
||||
|
||||
const auto* ent = &game::native::sp::g_entities[0];
|
||||
@ -271,7 +271,7 @@ void command::add_sp_commands()
|
||||
|
||||
add("god", []()
|
||||
{
|
||||
if (!game::native::Dvar_FindVar("sv_running")->current.enabled)
|
||||
if (!game::native::sp::IsServerRunning())
|
||||
return;
|
||||
|
||||
auto* ent = &game::native::sp::g_entities[0];
|
||||
@ -289,7 +289,7 @@ void command::add_sp_commands()
|
||||
|
||||
add("demigod", []()
|
||||
{
|
||||
if (!game::native::Dvar_FindVar("sv_running")->current.enabled)
|
||||
if (!game::native::sp::IsServerRunning())
|
||||
return;
|
||||
|
||||
auto* ent = &game::native::sp::g_entities[0];
|
||||
@ -307,7 +307,7 @@ void command::add_sp_commands()
|
||||
|
||||
add("notarget", []()
|
||||
{
|
||||
if (!game::native::Dvar_FindVar("sv_running")->current.enabled)
|
||||
if (!game::native::sp::IsServerRunning())
|
||||
return;
|
||||
|
||||
auto* ent = &game::native::sp::g_entities[0];
|
||||
|
Loading…
Reference in New Issue
Block a user