From d079f26fc1226e979a7db7a4f0dd6154ca136473 Mon Sep 17 00:00:00 2001 From: FEDERICOMB <41979395+FEDERICOMB96@users.noreply.github.com> Date: Tue, 31 Aug 2021 09:50:53 -0300 Subject: [PATCH] Implement CGib::SpawnHeadGib and CGib::SpawnRandomGibs (#650) --- regamedll/dlls/API/CAPI_Impl.cpp | 13 ++++++++++++- regamedll/public/regamedll/regamedll_api.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 59f619cc..17bf1231 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -42,6 +42,14 @@ CGrenade *PlantBomb_api(entvars_t *pevOwner, Vector &vecStart, Vector &vecVeloci return CGrenade::ShootSatchelCharge(pevOwner, vecStart, vecVelocity); } +CGib *SpawnHeadGib_api(entvars_t *pevVictim) { + return CGib::SpawnHeadGib(pevVictim); +} + +void SpawnRandomGibs_api(entvars_t *pevVictim, int cGibs, int human) { + CGib::SpawnRandomGibs(pevVictim, cGibs, human); +} + ReGameFuncs_t g_ReGameApiFuncs = { &CREATE_NAMED_ENTITY, @@ -60,7 +68,10 @@ ReGameFuncs_t g_ReGameApiFuncs = { Cmd_Argc_api, Cmd_Argv_api, - PlantBomb_api + PlantBomb_api, + + SpawnHeadGib_api, + SpawnRandomGibs_api }; GAMEHOOK_REGISTRY(CBasePlayer_Spawn); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index c4d947ff..2c7eaf11 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -663,6 +663,8 @@ struct ReGameFuncs_t { int (*Cmd_Argc)(); const char *(*Cmd_Argv)(int i); class CGrenade *(*PlantBomb)(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity); + class CGib *(*SpawnHeadGib)(entvars_t* pevVictim); + void (*SpawnRandomGibs)(entvars_t* pevVictim, int cGibs, int human); }; class IReGameApi {