7#include <mathlib/vector.h>
14 const auto onTeleport = [&entities, &before](CEntityInstance& pawn,
const Vector*,
const QAngle*,
const Vector*) {
26 Before(_hook.MakeLifecycle()),
33 if (!_bindings.Teleport)
35 return std::unexpected(
Error::Unsupported(
"the CBaseEntity::Teleport vtable slot did not bind"));
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod.
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Teleport(EntitySystem &entities, const Bindings &bindings)
Result< Subscription > HookVirtual(std::string_view name, const VirtualFn< Ret(Object *, Args...)> &function, Before &&before, After &&after=nullptr)
Hook a gamedata-bound virtual function on objects sharing its class vtable.
std::expected< void, Error > Status
std::expected< T, Error > Result
constexpr bool IsValidSlot(int slot)
static Result< Subscription > HookTeleport(const Bindings &bindings, EntitySystem &entities, Event< int > &before)
VirtualFn< void(CEntityInstance *, const Vector *, const QAngle *, const Vector *)> Teleport
static Error Unsupported(std::string detail)