Implement CGib::SpawnHeadGib and CGib::SpawnRandomGibs (#650)

This commit is contained in:
FEDERICOMB 2021-08-31 09:50:53 -03:00 committed by Sergey Shorokhov
parent f1b253e5b0
commit d079f26fc1
2 changed files with 14 additions and 1 deletions

View File

@ -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);

View File

@ -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 {