mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 05:25:44 +00:00
Add our custom gsc funcs
This commit is contained in:
parent
2e50e3274d
commit
6b612395b5
@ -1,5 +1,6 @@
|
|||||||
#include <stdinc.hpp>
|
#include <stdinc.hpp>
|
||||||
#include "clientscript_public.hpp"
|
#include "clientscript_public.hpp"
|
||||||
|
#include <component/gsc.hpp>
|
||||||
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable: 4244)
|
#pragma warning(disable: 4244)
|
||||||
@ -2010,6 +2011,14 @@ LABEL_17:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// our addition
|
||||||
|
auto f = gsc::function::get(pName, type);
|
||||||
|
if (f != nullptr)
|
||||||
|
{
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
// pluto
|
// pluto
|
||||||
if (game::plutonium::scr_get_function_hook != nullptr)
|
if (game::plutonium::scr_get_function_hook != nullptr)
|
||||||
{
|
{
|
||||||
@ -2145,6 +2154,14 @@ LABEL_17:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// our addition
|
||||||
|
auto f = gsc::method::get(pName, type);
|
||||||
|
if (f != nullptr)
|
||||||
|
{
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
// pluto
|
// pluto
|
||||||
if (game::plutonium::scr_get_method_hook != nullptr)
|
if (game::plutonium::scr_get_method_hook != nullptr)
|
||||||
{
|
{
|
||||||
|
@ -109,9 +109,17 @@ namespace gsc
|
|||||||
functions.insert_or_assign(name, function);
|
functions.insert_or_assign(name, function);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::unordered_map<std::string, game::BuiltinFunction>& get()
|
game::BuiltinFunction get(const char** name, int* type)
|
||||||
{
|
{
|
||||||
return functions;
|
auto got = functions.find(*name);
|
||||||
|
|
||||||
|
if (got == functions.end())
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
*type = 0;
|
||||||
|
return got->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,9 +130,17 @@ namespace gsc
|
|||||||
methods.insert_or_assign(name, method);
|
methods.insert_or_assign(name, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::unordered_map<std::string, game::BuiltinMethod>& get()
|
game::BuiltinMethod get(const char** name, int* type)
|
||||||
{
|
{
|
||||||
return methods;
|
auto got = methods.find(*name);
|
||||||
|
|
||||||
|
if (got == methods.end())
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
*type = 0;
|
||||||
|
return got->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ namespace gsc
|
|||||||
namespace function
|
namespace function
|
||||||
{
|
{
|
||||||
void add(const std::string& name, const game::BuiltinFunction function);
|
void add(const std::string& name, const game::BuiltinFunction function);
|
||||||
const std::unordered_map<std::string, game::BuiltinFunction>& get();
|
game::BuiltinFunction get(const char** name, int* type);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace method
|
namespace method
|
||||||
{
|
{
|
||||||
void add(const std::string& name, const game::BuiltinMethod method);
|
void add(const std::string& name, const game::BuiltinMethod method);
|
||||||
const std::unordered_map<std::string, game::BuiltinMethod>& get();
|
game::BuiltinMethod get(const char** name, int* type);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user