CTerrorPlayer::CleanupPlayerState
0x009b0190 · 2983 bytes · __thiscall
_ZN13CTerrorPlayer18CleanupPlayerStateEv
Decompiled
undefined (1 param)
/* CTerrorPlayer::CleanupPlayerState() */
void __thiscall CTerrorPlayer::CleanupPlayerState(CTerrorPlayer *this)
{
CTerrorPlayer CVar1;
CBaseEdict *pCVar2;
int *piVar3;
undefined *puVar4;
undefined *puVar5;
CTerrorPlayer *this_00;
int iVar6;
uint uVar7;
uint uVar8;
int iVar9;
*(undefined4 *)(this + 0x338c) = 0;
*(undefined4 *)(this + 0x3218) = 0xffffffff;
if (*(float *)(this + 0x3f18) != 0.0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3f18) = 0;
}
if (*(float *)(this + 0x3f1c) != 0.0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3f1c) = 0;
}
if (*(float *)(this + 0x3f20) != 0.0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3f20) = 0;
}
if (*(float *)(this + 0x3f24) != 0.0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3f24) = 0;
}
CBasePlayer::ClearUseEntity((CBasePlayer *)this);
SetPushEntity(this,(CBaseEntity *)0x0);
(**(code **)(*(int *)this + 0x38c))(this);
OnPounceEnded(this);
OnCarryEnded(this,true,false,true);
OnPummelEnded(this,true,(CTerrorPlayer *)0x0);
OnRideEnded(this,(CTerrorPlayer *)0x0);
uVar8 = *(uint *)(this + 0x3e4c);
if ((((uVar8 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar8 >> 0xc)) &&
(*(CBaseEntity **)(puVar4 + 4) != (CBaseEntity *)0x0)) {
CBaseEntity::SetMoveType(*(CBaseEntity **)(puVar4 + 4),2,0);
uVar8 = *(uint *)(this + 0x3e4c);
piVar3 = (int *)0x0;
if (((uVar8 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar8 >> 0xc)) {
piVar3 = *(int **)(puVar4 + 4);
}
(**(code **)(*piVar3 + 0x98))(piVar3,0,0xffffffff);
}
uVar8 = *(uint *)(this + 0x33c0);
if (((uVar8 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar4 + 8) == uVar8 >> 0xc &&
(*(CTerrorPlayer **)(puVar4 + 4) != (CTerrorPlayer *)0x0)))) {
AbilityDebug(this,*(CTerrorPlayer **)(puVar4 + 4),"Tongue letting go on death.");
}
ReleaseTongueVictim(this,false);
uVar8 = *(uint *)(this + 0x33c4);
if ((((uVar8 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar8 >> 0xc)) &&
(*(CTerrorPlayer **)(puVar4 + 4) != (CTerrorPlayer *)0x0)) {
ReleaseTongueVictim(*(CTerrorPlayer **)(puVar4 + 4),false);
}
CBaseEntity::RemoveFlag((CBaseEntity *)this,0x20);
if (*(float *)(this + 0x3260) == -1.0) {
CVar1 = this[0x3278];
}
else {
(**(code **)(*(int *)(this + 0x3258) + 4))(this + 0x3258,this + 0x3260);
CVar1 = this[0x3278];
*(undefined4 *)(this + 0x3260) = 0xbf800000;
}
if (CVar1 == (CTerrorPlayer)0x0) {
CVar1 = this[0x32fc];
}
else {
OnAdrenalineEnd(this);
CVar1 = this[0x32fc];
}
if (CVar1 == (CTerrorPlayer)0x0) {
CVar1 = this[0x2d94];
}
else {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
CVar1 = this[0x2d94];
this[0x32fc] = (CTerrorPlayer)0x0;
}
if (CVar1 != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x2d94] = (CTerrorPlayer)0x0;
}
*(undefined4 *)(this + 0x2da8) = 0xffffffff;
if (*(float *)(this + 0x2db0) != -1.0) {
(**(code **)(*(int *)(this + 0x2dac) + 4))(this + 0x2dac,this + 0x2db0);
*(undefined4 *)(this + 0x2db0) = 0xbf800000;
}
if (this[0x2e78] != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x2e78] = (CTerrorPlayer)0x0;
}
if (*(float *)(this + 0x2e84) != -1.0) {
(**(code **)(*(int *)(this + 0x2e7c) + 4))(this + 0x2e7c,this + 0x2e84);
*(undefined4 *)(this + 0x2e84) = 0xbf800000;
}
if (*(float *)(this + 0x32dc) != -1.0) {
(**(code **)(*(int *)(this + 0x32d4) + 4))(this + 0x32d4,this + 0x32dc);
*(undefined4 *)(this + 0x32dc) = 0xbf800000;
}
if (this[0x33a0] != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x33a0] = (CTerrorPlayer)0x0;
}
if (((*(float *)(this + 0x3394) != 0.0) || (*(float *)(this + 0x3398) != 0.0)) ||
(*(float *)(this + 0x339c) != 0.0)) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3394) = 0;
*(undefined4 *)(this + 0x3398) = 0;
*(undefined4 *)(this + 0x339c) = 0;
}
if (*(float *)(this + 0x2ea8) == -1.0) {
CVar1 = this[0x39f1];
}
else {
(**(code **)(*(int *)(this + 0x2ea0) + 4))(this + 0x2ea0,this + 0x2ea8);
CVar1 = this[0x39f1];
*(undefined4 *)(this + 0x2ea8) = 0xbf800000;
}
if (CVar1 != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x39f1] = (CTerrorPlayer)0x0;
}
ResetLightingOrigin(this);
if (this[0x39f2] == (CTerrorPlayer)0x0) {
CVar1 = this[0x33dc];
}
else {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
CVar1 = this[0x33dc];
this[0x39f2] = (CTerrorPlayer)0x0;
}
if (CVar1 == (CTerrorPlayer)0x0) {
CVar1 = this[0x33dd];
}
else {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
CVar1 = this[0x33dd];
this[0x33dc] = (CTerrorPlayer)0x0;
}
if (CVar1 == (CTerrorPlayer)0x0) {
CVar1 = this[0x33e4];
}
else {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
CVar1 = this[0x33e4];
this[0x33dd] = (CTerrorPlayer)0x0;
}
if (CVar1 != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x33e4] = (CTerrorPlayer)0x0;
}
if (*(float *)(this + 0x39f8) != -1.0) {
(**(code **)(*(int *)(this + 0x39f4) + 4))(this + 0x39f4,this + 0x39f8);
*(undefined4 *)(this + 0x39f8) = 0xbf800000;
}
this[0x3a2c] = (CTerrorPlayer)0x0;
this[0x3f04] = (CTerrorPlayer)0x0;
if (this[0x3f14] != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x3f14] = (CTerrorPlayer)0x0;
}
if (*(float *)(this + 0x3e3c) != -1.0) {
(**(code **)(*(int *)(this + 0x3e34) + 4))(this + 0x3e34,this + 0x3e3c);
*(undefined4 *)(this + 0x3e3c) = 0xbf800000;
}
uVar8 = *(uint *)(this + 0x2e28);
this[0x3e40] = (CTerrorPlayer)0x0;
this[0x2ccc] = (CTerrorPlayer)0x0;
if (uVar8 == 0xffffffff) {
uVar8 = 0xffffffff;
}
else {
puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10;
if (((puVar4 != (undefined *)0xfffffffc) && (*(uint *)(puVar4 + 8) == uVar8 >> 0xc)) &&
(piVar3 = *(int **)(puVar4 + 4), piVar3 != (int *)0x0)) {
(**(code **)(*piVar3 + 0x7fc))(piVar3,0x30,0);
uVar8 = *(uint *)(this + 0x2e28);
this_00 = (CTerrorPlayer *)0x0;
if (((uVar8 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar8 >> 0xc)) {
this_00 = *(CTerrorPlayer **)(puVar4 + 4);
}
StopBeingRevived(this_00,true);
uVar8 = *(uint *)(this + 0x2e28);
}
}
puVar4 = g_pEntityList;
if ((g_pEntityList == (undefined *)0xfffffffc) || (*(int *)(g_pEntityList + 8) != 0)) {
iVar9 = 0;
}
else {
iVar9 = *(int *)(g_pEntityList + 4);
}
if (((uVar8 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar8 >> 0xc)) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(puVar5 + 4);
}
if (iVar9 != iVar6) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
puVar4 = g_pEntityList;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x2e28) = 0;
}
uVar8 = *(uint *)(this + 0x2e24);
uVar7 = 0xffffffff;
if ((((uVar8 != 0xffffffff) &&
(puVar5 = puVar4 + (uVar8 & 0xfff) * 0x10, uVar7 = uVar8, puVar5 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar5 + 8) == uVar8 >> 0xc)) &&
(*(CTerrorPlayer **)(puVar5 + 4) != (CTerrorPlayer *)0x0)) {
StopRevivingSomeone(*(CTerrorPlayer **)(puVar5 + 4),true);
puVar4 = g_pEntityList;
uVar7 = *(uint *)(this + 0x2e24);
}
if ((puVar4 == (undefined *)0xfffffffc) || (*(int *)(puVar4 + 8) != 0)) {
iVar9 = 0;
}
else {
iVar9 = *(int *)(puVar4 + 4);
}
if (((uVar7 == 0xffffffff) ||
(puVar4 = puVar4 + (uVar7 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar4 + 8) != uVar7 >> 0xc)) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(puVar4 + 4);
}
if (iVar9 != iVar6) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar9 + 2) = 0;
}
*(undefined4 *)(this + 0x2e24) = 0;
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x2e24) = 0;
}
}
this[0x400d] = (CTerrorPlayer)0x1;
StopUseActions(this);
CBaseEntity::EmitSound((CBaseEntity *)this,"Player.StopVoice",0.0,(float *)0x0);
CBaseEntity::EmitSound((CBaseEntity *)this,"Player.StopItem",0.0,(float *)0x0);
CBaseEntity::EmitSound((CBaseEntity *)this,"Player.StopBody",0.0,(float *)0x0);
StopTrackedSound(this,"BoomerZombie.Gurgle");
StopTrackedSound(this,"Player.Fall");
StopTrackedSound(this,"Player.Heartbeat");
return;
}
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.