Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion regamedll/dlls/API/CAPI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions regamedll/public/regamedll/regamedll_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,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 {
Expand Down