7#include <entity2/entityinstance.h>
10#include <vscript/ivscript.h>
27 for (; description; description = description->m_pBaseDesc)
58 return static_cast<int8_t>(
code[5]) /
static_cast<int>(
sizeof(
void*));
71 return (value & 1) != 0 ?
static_cast<int>((value - 1) /
sizeof(
void*)) : -1;
79 const int slot = KHook::GetVtableIndex(&CEntityInstance::GetScriptDesc);
82 return std::unexpected(
Error::NotFound(
"no vtable slot for GetScriptDesc"));
88 return std::unexpected(
Error::NotFound(
"the class has no VScript description"));
94 return std::unexpected(
Error::NotFound(std::format(
"no VScript binding '{}'", name)));
static int VirtualIndex(const void *function)
static std::string ReadFile(const std::filesystem::path &path)
bool IsReadableAddress(const void *address, size_t bytes)
Result< ScriptTarget > FindScriptBinding(void *classTable, std::string_view name)
static const ScriptFunctionBinding * FindBinding(const ScriptClassDesc_t *description, std::string_view name)
std::expected< T, Error > Result
static Error NotFound(std::string detail)
ScriptBindingFunc_t Binding
ScriptClassDesc_t * Class
ScriptFuncDescriptor_t Descriptor