CPropMountedGun::UpdateHeat
0x0054eb70 · 866 bytes · __thiscall
_ZN15CPropMountedGun10UpdateHeatEf
Decompiled
undefined (2 params)
/* CPropMountedGun::UpdateHeat(float) */
void __thiscall CPropMountedGun::UpdateHeat(CPropMountedGun *this,float param_1)
{
uint uVar1;
CBaseEdict *pCVar2;
code *pcVar3;
char cVar4;
int iVar5;
int *piVar6;
undefined4 uVar7;
undefined *puVar8;
float fVar9;
float fVar10;
float fVar11;
uVar1 = *(uint *)(this + 0x15cc);
if ((((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) &&
((piVar6 = *(int **)(puVar8 + 4), piVar6 != (int *)0x0 &&
(cVar4 = (**(code **)(*piVar6 + 0x778))(piVar6), cVar4 != '\0')))) {
return;
}
if (this[0x15dc] == (CPropMountedGun)0x0) {
fVar10 = *(float *)(this + 0x15e0);
fVar11 = fVar10 - param_1 / *(float *)(mounted_gun_cooldown_time._28_4_ + 0x2c);
fVar9 = 0.0;
if (0.0 <= fVar11) {
fVar9 = fVar11;
}
if (fVar10 != fVar9) {
if (this[0x6c] == (CPropMountedGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15e0) = fVar9;
fVar10 = fVar9;
}
}
else {
fVar10 = *(float *)(this + 0x15e0);
fVar9 = param_1 / *(float *)(mounted_gun_overheat_time._28_4_ + 0x2c) + fVar10;
if (1.0 <= fVar9) {
fVar9 = 1.0;
}
if (fVar10 != fVar9) {
if (this[0x6c] == (CPropMountedGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
}
*(float *)(this + 0x15e0) = fVar9;
fVar10 = fVar9;
}
}
if (fVar10 == 1.0) {
if (this[0x15dd] != (CPropMountedGun)0x1) {
if (this[0x6c] == (CPropMountedGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
}
this[0x15dd] = (CPropMountedGun)0x1;
}
if (this[0x15dc] != (CPropMountedGun)0x0) {
if (this[0x6c] == (CPropMountedGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
}
this[0x15dc] = (CPropMountedGun)0x0;
}
OnFireStop(this);
uVar1 = *(uint *)(this + 0x15cc);
if ((((uVar1 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) &&
((*(int *)(puVar8 + 4) != 0 &&
(piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"mounted_gun_overheated",0,0),
piVar6 != (int *)0x0)))) {
pcVar3 = *(code **)(*piVar6 + 0x30);
uVar1 = *(uint *)(this + 0x15cc);
if ((uVar1 == 0xffffffff) ||
((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc ||
(*(uint *)(puVar8 + 8) != uVar1 >> 0xc)))) {
iVar5 = 0;
}
else {
iVar5 = *(int *)(puVar8 + 4);
}
uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar5 + 0x30));
(*pcVar3)(piVar6,"userid",uVar7);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
}
else if ((this[0x15dd] != (CPropMountedGun)0x0) &&
(fVar10 <= 1.0 - *(float *)(mounted_gun_overheat_penalty_time._28_4_ + 0x2c) /
*(float *)(mounted_gun_cooldown_time._28_4_ + 0x2c))) {
if (this[0x6c] == (CPropMountedGun)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this[0x70] = (CPropMountedGun)((byte)this[0x70] | 1);
}
this[0x15dd] = (CPropMountedGun)0x0;
}
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.