CTerrorPlayer::AddSurvivorDamage
0x009aa490 · 959 bytes · __thiscall
_ZN13CTerrorPlayer17AddSurvivorDamageEib21SurvivorCharacterType
Decompiled
undefined (4 params)
/* CTerrorPlayer::AddSurvivorDamage(int, bool, SurvivorCharacterType) */
void __thiscall
CTerrorPlayer::AddSurvivorDamage(CTerrorPlayer *this,int param_1,char param_2,uint param_4)
{
int iVar1;
CBaseEdict *pCVar2;
char cVar3;
int iVar4;
undefined4 uVar5;
int iVar6;
iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
if (iVar4 == 3) {
iVar4 = *(int *)(z_max_survivor_damage._28_4_ + 0x30);
if (param_1 <= *(int *)(z_max_survivor_damage._28_4_ + 0x30)) {
iVar4 = param_1;
}
uVar5 = (**(code **)(*(int *)this + 0x544))(this);
switch(uVar5) {
case 1:
iVar1 = *(int *)(this + 0x3998) + iVar4;
if (*(int *)(this + 0x3998) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3998) = iVar1;
}
break;
case 2:
iVar1 = *(int *)(this + 0x399c) + iVar4;
if (*(int *)(this + 0x399c) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x399c) = iVar1;
}
break;
case 3:
iVar1 = *(int *)(this + 0x3994) + iVar4;
if (*(int *)(this + 0x3994) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3994) = iVar1;
}
break;
case 4:
iVar1 = *(int *)(this + 0x39a4) + iVar4;
if (*(int *)(this + 0x39a4) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x39a4) = iVar1;
}
break;
case 5:
iVar1 = *(int *)(this + 0x39a0) + iVar4;
if (*(int *)(this + 0x39a0) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x39a0) = iVar1;
}
break;
case 6:
iVar1 = *(int *)(this + 0x39a8) + iVar4;
if (*(int *)(this + 0x39a8) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x39a8) = iVar1;
}
break;
case 8:
iVar1 = *(int *)(this + 0x3990) + iVar4;
if (*(int *)(this + 0x3990) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3990) = iVar1;
}
}
if ((g_pGameRules != (int *)0x0) &&
(cVar3 = CTerrorGameRules::HasPlayerControlledZombies(), cVar3 != '\0')) {
(**(code **)(*g_pGameRules + 0x2d8))(g_pGameRules,this,iVar4,param_2);
}
iVar1 = *(int *)(this + 0x3080) + iVar4;
if (*(int *)(this + 0x3080) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3080) = iVar1;
}
iVar1 = *(int *)(this + 0x3084) + iVar4;
if (*(int *)(this + 0x3084) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3084) = iVar1;
}
iVar1 = *(int *)(this + 0x3088) + iVar4;
if (*(int *)(this + 0x3088) != iVar1) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(int *)(this + 0x3088) = iVar1;
}
if (param_4 < 4) {
if (param_2 == '\0') {
*(int *)(this + param_4 * 0x34 + 0x2f78) = *(int *)(this + param_4 * 0x34 + 0x2f78) + iVar4;
*(int *)(this + 0x3048) = *(int *)(this + 0x3048) + iVar4;
return;
}
*(int *)(this + param_4 * 0x34 + 0x2f7c) = *(int *)(this + param_4 * 0x34 + 0x2f7c) + iVar4;
*(int *)(this + 0x304c) = *(int *)(this + 0x304c) + iVar4;
}
}
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.