CEntityDissolve::Create
0x006790d0 · 900 bytes · __cdecl
_ZN15CEntityDissolve6CreateEP11CBaseEntityPKcfiPb
Decompiled
undefined (5 params)
/* CEntityDissolve::Create(CBaseEntity*, char const*, float, int, bool*) */
CBaseEntity *
CEntityDissolve::Create(CBaseEntity *param_1,char *param_2,float param_3,int param_4,bool *param_5)
{
CBaseEdict *pCVar1;
char cVar2;
CBaseEntity *this;
int iVar3;
undefined1 *puVar4;
int iVar5;
int *piVar6;
CBaseAnimating *pCVar7;
CBaseEntity *this_00;
Vector *pVVar8;
Vector *pVVar9;
CBaseEntity *pCVar10;
undefined1 *local_e0;
CTakeDamageInfo local_dc [96];
CTakeDamageInfo local_7c [108];
if (param_5 != (bool *)0x0) {
*param_5 = false;
}
cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
if (cVar2 != '\0') {
CBasePlayer::SetArmorValue((CBasePlayer *)param_1,0);
CTakeDamageInfo::CTakeDamageInfo
(local_7c,param_1,param_1,(float)*(int *)(param_1 + 0x100),0x400800,0);
CBaseEntity::TakeDamage(param_1,local_7c);
return (CBaseEntity *)0x0;
}
this = (CBaseEntity *)CreateEntityByName("env_entity_dissolver",-1,true);
if (this == (CBaseEntity *)0x0) {
this = (CBaseEntity *)0x0;
}
else {
if (*(int *)(this + 0x45c) != param_4) {
if (this[0x6c] == (CBaseEntity)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
*(int *)(this + 0x45c) = param_4;
}
this_00 = param_1;
if ((param_4 - 1U < 2) &&
(cVar2 = (**(code **)(*(int *)param_1 + 0x140))(param_1), cVar2 != '\0')) {
piVar6 = (int *)CBaseEntity::MyNPCPointer();
cVar2 = (**(code **)(*piVar6 + 0x350))(piVar6);
if (cVar2 != '\0') {
CTakeDamageInfo::CTakeDamageInfo(local_dc);
pCVar7 = (CBaseAnimating *)CBaseEntity::MyNPCPointer();
this_00 = (CBaseEntity *)CreateServerRagdoll(pCVar7,0,local_dc,1,true);
pVVar8 = (Vector *)(**(code **)(*(int *)(param_1 + 0x194) + 8))(param_1 + 0x194);
pVVar9 = (Vector *)(**(code **)(*(int *)(param_1 + 0x194) + 4))(param_1 + 0x194);
CBaseEntity::SetCollisionBounds(this_00,pVVar9,pVVar8);
if (param_1[0x104] == (CBaseEntity)0x0) {
pCVar10 = (CBaseEntity *)UTIL_PlayerByIndex(1);
CTakeDamageInfo::CTakeDamageInfo(local_7c,pCVar10,pCVar10,10000.0,0x400900,0);
CBaseEntity::TakeDamage(param_1,local_7c);
}
if (param_5 != (bool *)0x0) {
*param_5 = true;
}
UTIL_Remove(param_1);
}
}
AllocPooledString((char *)&local_e0);
*(undefined1 **)(this + 0x260) = local_e0;
CBaseEntity::DispatchUpdateTransmitState(this);
puVar4 = &DAT_00d539c2;
if (local_e0 != (undefined1 *)0x0) {
puVar4 = local_e0;
}
iVar3 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar4);
if (iVar3 != *(int *)(this + 0xf4)) {
if (this[0x6c] == (CBaseEntity)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
*(int *)(this + 0xf4) = iVar3;
}
AttachToEntity((CEntityDissolve *)this,this_00);
if (param_3 != *(float *)(this + 0x440)) {
if (this[0x6c] == (CBaseEntity)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
}
*(float *)(this + 0x440) = param_3;
}
(**(code **)(*(int *)this + 100))(this);
*(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x80;
CBaseEntity::DispatchUpdateTransmitState(this);
if (param_4 - 1U < 2) {
(**(code **)(*(int *)this_00 + 0xfc))(this_00,"TLK_ELECTROCUTESCREAM");
return this;
}
(**(code **)(*(int *)this_00 + 0xfc))(this_00,"TLK_DISSOLVESCREAM");
}
return this;
}
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.