-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CRagdollProp - CreateServerRagdoll
- Loading branch information
1 parent
2fb3c35
commit c052fdf
Showing
5 changed files
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
scripting/include/srccoop_api/classdef/common/CRagdollProp.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,35 @@ | ||
#pragma newdecls required | ||
#pragma semicolon 1 | ||
|
||
static Handle g_pCreateServerRagdoll; | ||
|
||
methodmap CRagdollProp < CBaseAnimating | ||
{ | ||
public static void InitClassdef(const GameData hGameConfig) | ||
{ | ||
char szCreateServerRagdoll[] = "CreateServerRagdoll"; | ||
StartPrepSDKCall(SDKCall_Static); | ||
if (!PrepSDKCall_SetFromConf(hGameConfig, SDKConf_Signature, szCreateServerRagdoll)) | ||
LogMessage("Could not obtain gamedata signature %s", szCreateServerRagdoll); | ||
PrepSDKCall_SetReturnInfo(SDKType_CBaseEntity, SDKPass_Pointer); | ||
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer); // CBaseAnimating *pAnimating | ||
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain); // int forceBone | ||
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain); // const CTakeDamageInfo &info | ||
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain); // int collisionGroup | ||
PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); // bool bUseLRURetirement | ||
if (!(g_pCreateServerRagdoll = EndPrepSDKCall())) | ||
SetFailState("Could not prep SDK call %s", szCreateServerRagdoll); | ||
} | ||
public CRagdollProp(const int iEntIndex = -1) | ||
{ | ||
return view_as<CRagdollProp>(CBaseAnimating(iEntIndex)); | ||
} | ||
} | ||
|
||
stock CRagdollProp CreateServerRagdoll(const CBaseAnimating pAnimating, const int iForceBone, const CTakeDamageInfo pInfo, const Collision_Group_t eCollisionGroup, const bool bUseLRURetirement = false) | ||
{ | ||
return CRagdollProp | ||
( | ||
SDKCall(g_pCreateServerRagdoll, pAnimating.entindex, iForceBone, pInfo, eCollisionGroup, bUseLRURetirement) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters