CSurvivorDeathModel::Create
0x009b24e0 · 698 bytes · __cdecl
_ZN19CSurvivorDeathModel6CreateEP13CTerrorPlayer
Decompiled
undefined (1 param)
/* CSurvivorDeathModel::Create(CTerrorPlayer*) */
CBaseEntity * CSurvivorDeathModel::Create(CTerrorPlayer *param_1)
{
CBaseEdict *pCVar1;
code *pcVar2;
char cVar3;
CBaseEntity *this;
int iVar4;
undefined4 uVar5;
int iVar6;
CBaseEntity *this_00;
if (param_1 != (CTerrorPlayer *)0x0) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
}
}
this = (CBaseEntity *)
CBaseEntity::Create("survivor_death_model",(Vector *)(param_1 + 0x2e0),
(QAngle *)(param_1 + 0x37c),(CBaseEntity *)0x0);
if (this != (CBaseEntity *)0x0) {
iVar6 = *(int *)(param_1 + 0x2ba0);
if (iVar6 != *(int *)(this + 0x17d8)) {
if (this[0x6c] == (CBaseEntity)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar4 + 2) = 0;
}
*(int *)(this + 0x17d8) = iVar6;
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
*(int *)(this + 0x17d8) = iVar6;
}
}
pcVar2 = *(code **)(*(int *)this + 0x24);
uVar5 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
(*pcVar2)(this,uVar5);
pcVar2 = *(code **)(*(int *)this + 0x340);
cVar3 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1);
iVar6 = (*pcVar2)(this,~-(uint)(cVar3 == '\0') + 0x199);
CBaseAnimating::SetSequence((CBaseAnimating *)this,iVar6);
if (*(float *)(this + 0x468) != 1.0) {
if (this[0x6c] == (CBaseEntity)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x468) = 0x3f800000;
}
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
CBaseEntity::SetMoveType(this,3,0);
CBaseEntity::SetFriction(this,1.0);
iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar4 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
CBaseEntity::SetCollisionBounds(this,(Vector *)(iVar4 + 0x24),(Vector *)(iVar6 + 0x30));
if (this[0x105] != (CBaseEntity)0x0) {
(**(code **)(*(int *)this + 0x224))(this,this + 0x105);
this[0x105] = (CBaseEntity)0x0;
}
CBaseEntity::SetCollisionGroup(this,1);
this_00 = (CBaseEntity *)CTerrorPlayer::GetPlayerByCharacter(*(undefined4 *)(this + 0x17d8));
if (this_00 != (CBaseEntity *)0x0) {
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
CBaseEntity::SetAbsOrigin(this,(Vector *)(this_00 + 0x2e0));
}
CBaseEntity::SetAbsVelocity(this,(Vector *)&vec3_origin);
CCollisionProperty::SetSolidFlags
((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 4));
(**(code **)(*(int *)this + 0x194))(this,2);
CBaseAnimating::UseClientSideAnimation((CBaseAnimating *)this);
VisibilityMonitor_AddEntity
(this,400.0,VisibilityMonitorCallback,
(_func_bool_CBaseEntity_ptr_CBasePlayer_ptr *)0x0);
return this;
}
}
return (CBaseEntity *)0x0;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.