CTankClaw::OnSwingStart
0x0055fc60 · 3281 bytes · __thiscall
_ZN9CTankClaw12OnSwingStartEv
Decompiled
undefined (1 param)
/* CTankClaw::OnSwingStart() */
void __thiscall CTankClaw::OnSwingStart(CTankClaw *this)
{
CTankClaw *pCVar1;
CTankClaw CVar2;
code *pcVar3;
int *piVar4;
uint *puVar5;
CBaseEdict *this_00;
char cVar6;
CBasePlayer *this_01;
QAngle *pQVar7;
int iVar8;
undefined4 uVar9;
float *pfVar10;
int iVar11;
int iVar12;
int *piVar13;
int *piVar14;
longdouble lVar15;
float fVar16;
float fVar17;
float local_25c;
float local_258;
float local_254;
float local_250;
float local_24c;
float local_248;
float local_244;
float local_240;
float local_23c;
undefined4 local_238;
undefined4 local_234;
undefined4 local_230;
float local_22c;
float local_228;
float local_224;
undefined4 local_220;
undefined4 local_21c;
undefined4 local_218;
undefined4 local_214;
undefined4 local_210;
undefined4 local_20c;
float local_208;
float local_204;
float local_200;
undefined **local_1fc [4];
undefined **local_1ec;
CBasePlayer *local_1e8;
undefined4 local_1e4;
undefined4 local_1e0;
undefined4 local_1dc;
undefined4 local_1d8;
undefined4 local_1d4;
int local_1d0 [5];
float local_1bc;
float local_1b8;
float local_1b4;
float local_1ac;
float local_1a8;
float local_1a4;
undefined4 local_19c;
undefined4 local_198;
undefined4 local_194;
undefined4 local_18c;
undefined4 local_188;
undefined4 local_184;
undefined4 local_17c;
undefined1 local_178;
undefined1 local_177;
float local_16c;
float local_168;
float local_164;
float local_15c;
float local_158;
float local_154;
undefined4 local_14c;
undefined4 local_148;
undefined4 local_144;
undefined4 local_13c;
undefined4 local_138;
undefined4 local_134;
undefined4 local_12c;
undefined1 local_128;
undefined1 local_127;
float local_11c;
float local_118;
float local_114;
float local_10c;
float local_108;
float local_104;
undefined4 local_fc;
undefined4 local_f8;
undefined4 local_f4;
undefined4 local_ec;
undefined4 local_e8;
undefined4 local_e4;
undefined4 local_dc;
undefined1 local_d8;
undefined1 local_d7;
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_9c;
undefined4 local_98;
undefined4 local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
float local_70;
float local_6c;
float local_68;
undefined1 local_64 [32];
float local_44;
this_01 = (CBasePlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (this_01 != (CBasePlayer *)0x0) {
(**(code **)(*(int *)this_01 + 0x620))();
CBasePlayer::EyeVectors(this_01,(Vector *)&local_25c,(Vector *)0x0,(Vector *)0x0);
fVar17 = *(float *)(HulkSwingRange._28_4_ + 0x2c);
fVar16 = fVar17 * local_254;
(**(code **)(*(int *)this_01 + 0x234))();
this[0x1820] = (CTankClaw)0x0;
this[0x1821] = (CTankClaw)0x0;
*(undefined4 *)(this + 0x180c) = 0;
*(float *)(this + 0x1818) = local_258 * fVar17 + local_6c;
*(float *)(this + 0x1814) = local_25c * fVar17 + local_70;
*(float *)(this + 0x181c) = fVar16 + local_68;
cVar6 = CTerrorGameRules::HasPlayerControlledZombies();
fVar17 = 0.0;
if (cVar6 != '\0') {
fVar17 = *(float *)(HulkPZForward._28_4_ + 0x2c);
}
if (local_254 <= fVar17) {
pQVar7 = (QAngle *)(**(code **)(*(int *)this_01 + 0x238))();
AngleVectors(pQVar7,(Vector *)&local_250);
local_248 = 0.0;
fVar16 = local_250 * 26.625;
fVar17 = local_24c * 26.625;
(**(code **)(*(int *)this_01 + 0x234))();
local_238 = 0x42b40000;
local_244 = fVar16 + local_70;
local_240 = fVar17 + local_6c;
local_234 = 0;
local_230 = 0;
local_23c = local_68;
AngleVectors((QAngle *)&local_238,(Vector *)&local_250);
local_178 = 0;
local_220 = 0xc28e0000;
local_21c = 0xc28e0000;
local_218 = 0xc28e0000;
local_214 = 0x428e0000;
local_210 = 0x428e0000;
local_228 = local_24c * 142.0 + local_240;
local_20c = 0x428e0000;
local_224 = local_248 * 142.0 + local_23c;
local_17c = 0;
local_22c = local_250 * 142.0 + local_244;
local_18c = 0x428e0000;
local_1a8 = local_228 - local_240;
local_1a4 = local_224 - local_23c;
local_1ac = local_22c - local_244;
local_188 = 0x428e0000;
local_184 = 0x428e0000;
local_19c = 0;
local_198 = 0;
local_194 = 0;
local_1bc = local_244;
local_1b8 = local_240;
local_1b4 = local_23c;
local_1ec = &PTR_EnumElement_00c50470;
local_1d0[0] = 0;
local_177 = local_1a8 * local_1a8 + local_1ac * local_1ac + local_1a4 * local_1a4 != 0.0;
local_1d0[1] = 0;
local_1dc = local_238;
local_1d0[2] = 0;
local_1d0[3] = 0;
local_1d8 = local_234;
local_1d0[4] = 0;
local_1e4 = 0;
local_1e0 = 0xbf800000;
local_1d4 = local_230;
/* try { // try from 005600cf to 00560452 has its CatchHandler @ 0056094a */
local_1e8 = this_01;
(**(code **)(*partition + 0x40))();
if (*(int *)(ZombieShowSwings._28_4_ + 0x30) != 0) {
/* try { // try from 00560510 to 00560514 has its CatchHandler @ 0056094a */
NDebugOverlay::SweptBox
((Vector *)&local_244,(Vector *)&local_22c,(Vector *)&local_220,
(Vector *)&local_214,(QAngle *)&vec3_angle,0xff,0xff,0xff,0x32,10.1);
}
piVar14 = (int *)&stack0xfffffd5c;
if (0 < local_1d0[3]) {
iVar11 = 0;
piVar13 = (int *)&stack0xfffffd5c;
do {
while (piVar4 = *(int **)(local_1d0[0] + iVar11 * 4), piVar4 == (int *)0x0) {
LAB_005600f8:
iVar11 = iVar11 + 1;
piVar14 = piVar13;
if (local_1d0[3] <= iVar11) goto LAB_005603a0;
}
iVar8 = *piVar4;
*piVar13 = (int)piVar4;
pcVar3 = *(code **)(iVar8 + 0x16c);
piVar13[-1] = 0x56011f;
cVar6 = (*pcVar3)();
if (cVar6 == '\0') goto LAB_005600f8;
*piVar13 = (int)piVar4;
piVar13[-1] = 0x56012b;
iVar8 = CBaseEntity::GetTeamNumber((CBaseEntity *)*piVar13);
*piVar13 = iVar8;
piVar13[-1] = 0x560133;
cVar6 = IsASurvivorTeam(iVar8);
if (cVar6 == '\0') goto LAB_005600f8;
iVar8 = *piVar4;
*piVar13 = (int)piVar4;
pcVar3 = *(code **)(iVar8 + 300);
piVar13[-1] = 0x560142;
cVar6 = (*pcVar3)();
if (cVar6 == '\0') goto LAB_005600f8;
iVar8 = *piVar4;
*piVar13 = (int)piVar4;
pcVar3 = *(code **)(iVar8 + 0x7e8);
piVar13[-1] = 0x560151;
cVar6 = (*pcVar3)();
if (cVar6 == '\0') goto LAB_005600f8;
piVar13[3] = 0;
piVar13[2] = 0;
piVar13[1] = 0;
*piVar13 = (int)local_1fc;
piVar13[-1] = 0x56017b;
CTraceFilterSimple::CTraceFilterSimple
((CTraceFilterSimple *)*piVar13,(IHandleEntity *)piVar13[1],piVar13[2],
(_func_bool_IHandleEntity_ptr_int *)piVar13[3]);
local_1fc[0] = &PTR_ShouldHitEntity_00c54558;
iVar8 = *piVar4;
piVar13[1] = (int)piVar4;
*piVar13 = (int)&local_208;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-1] = 0x56019a;
(*pcVar3)();
iVar8 = *(int *)this_01;
*piVar13 = 0;
piVar13[-1] = (int)this_01;
pcVar3 = *(code **)(iVar8 + 0x7a0);
piVar13[-2] = 0x5601b6;
uVar9 = (*pcVar3)();
iVar8 = *(int *)this_01;
*piVar13 = (int)this_01;
piVar13[-1] = (int)&local_cc;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-2] = 0x5601d7;
(*pcVar3)();
local_134 = 0;
local_128 = 1;
local_16c = local_cc;
local_15c = local_208 - local_cc;
local_138 = 0;
local_154 = local_200 - local_c4;
local_13c = 0;
local_12c = 0;
local_158 = local_204 - local_c8;
local_144 = 0;
local_148 = 0;
local_168 = local_c8;
local_14c = 0;
local_164 = local_c4;
local_127 = local_15c * local_15c + local_154 * local_154 + local_158 * local_158 != 0.0;
iVar8 = *enginetrace;
piVar13[2] = (int)&local_70;
piVar13[1] = (int)local_1fc;
piVar13[-2] = (int)enginetrace;
*piVar13 = uVar9;
piVar13[-1] = (int)&local_16c;
pcVar3 = *(code **)(iVar8 + 0x14);
piVar13[-3] = 0x5602e6;
(*pcVar3)();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
piVar13[4] = -0x40800000;
piVar13[-1] = (int)local_64;
piVar13[3] = 1;
piVar13[2] = 0;
piVar13[1] = 0;
*piVar13 = 0xff;
piVar13[-2] = (int)&local_70;
piVar13[-3] = 0x56032c;
DebugDrawLine((Vector *)piVar13[-2],(Vector *)piVar13[-1],*piVar13,piVar13[1],piVar13[2]
,SUB41(piVar13[3],0),(float)piVar13[4]);
}
piVar14 = piVar13 + -2;
if (local_44 < 1.0) {
piVar13[-1] = (int)"rfoot";
piVar13[1] = (int)&local_16c;
*piVar13 = (int)&local_208;
piVar13[-2] = (int)piVar4;
/* try { // try from 005605b0 to 00560935 has its CatchHandler @ 0056094a */
piVar13[-3] = 0x5605b5;
CBaseAnimating::GetAttachment
((CBaseAnimating *)piVar13[-2],(char *)piVar13[-1],(Vector *)*piVar13,
(QAngle *)piVar13[1]);
iVar8 = *(int *)this_01;
piVar13[-1] = 0;
piVar13[-2] = (int)this_01;
pcVar3 = *(code **)(iVar8 + 0x7a0);
piVar13[-3] = 0x5605ce;
iVar12 = (*pcVar3)();
iVar8 = *(int *)this_01;
piVar13[-1] = (int)this_01;
piVar13[-2] = (int)&local_cc;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-3] = 0x5605ef;
(*pcVar3)();
local_e4 = 0;
local_d8 = 1;
local_11c = local_cc;
local_10c = local_208 - local_cc;
local_e8 = 0;
local_108 = local_204 - local_c8;
local_ec = 0;
local_dc = 0;
local_104 = local_200 - local_c4;
local_f4 = 0;
local_f8 = 0;
local_118 = local_c8;
local_fc = 0;
local_114 = local_c4;
local_d7 = local_108 * local_108 + local_10c * local_10c + local_104 * local_104 != 0.0;
iVar8 = *enginetrace;
piVar13[1] = (int)&local_70;
*piVar13 = (int)local_1fc;
piVar13[-3] = (int)enginetrace;
piVar13[-1] = iVar12;
piVar13[-2] = (int)&local_11c;
pcVar3 = *(code **)(iVar8 + 0x14);
piVar13[-4] = 0x5606fe;
(*pcVar3)();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
piVar13[3] = -0x40800000;
piVar13[-2] = (int)local_64;
piVar13[2] = 1;
piVar13[1] = 0;
*piVar13 = 0;
piVar13[-1] = 0xff;
piVar13[-3] = (int)&local_70;
piVar13[-4] = 0x560744;
DebugDrawLine((Vector *)piVar13[-3],(Vector *)piVar13[-2],piVar13[-1],*piVar13,
piVar13[1],SUB41(piVar13[2],0),(float)piVar13[3]);
}
piVar14 = piVar13 + -3;
if (local_44 < 1.0) {
piVar13[-2] = (int)"eyes";
*piVar13 = (int)&local_16c;
piVar13[-1] = (int)&local_208;
piVar13[-3] = (int)piVar4;
piVar13[-4] = 0x56077e;
CBaseAnimating::GetAttachment
((CBaseAnimating *)piVar13[-3],(char *)piVar13[-2],(Vector *)piVar13[-1],
(QAngle *)*piVar13);
iVar8 = *(int *)this_01;
piVar13[-2] = 0;
piVar13[-3] = (int)this_01;
pcVar3 = *(code **)(iVar8 + 0x7a0);
piVar13[-4] = 0x560797;
iVar12 = (*pcVar3)();
iVar8 = *(int *)this_01;
piVar13[-2] = (int)this_01;
piVar13[-3] = (int)&local_11c;
pcVar3 = *(code **)(iVar8 + 0x234);
piVar13[-4] = 0x5607b8;
(*pcVar3)();
local_94 = 0;
local_88 = 1;
local_cc = local_11c;
local_bc = local_208 - local_11c;
local_98 = 0;
local_b8 = local_204 - local_118;
local_9c = 0;
local_8c = 0;
local_b4 = local_200 - local_114;
local_a4 = 0;
local_a8 = 0;
local_c8 = local_118;
local_ac = 0;
local_c4 = local_114;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
iVar8 = *enginetrace;
*piVar13 = (int)&local_70;
piVar13[-1] = (int)local_1fc;
piVar13[-4] = (int)enginetrace;
piVar13[-2] = iVar12;
piVar13[-3] = (int)&local_cc;
pcVar3 = *(code **)(iVar8 + 0x14);
piVar13[-5] = 0x5608c7;
(*pcVar3)();
piVar14 = piVar13 + -4;
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
piVar13[2] = -0x40800000;
piVar13[-3] = (int)local_64;
piVar13[1] = 1;
*piVar13 = 0;
piVar13[-1] = 0;
piVar13[-2] = 0xff;
piVar13[-4] = (int)&local_70;
piVar13[-5] = 0x56090d;
DebugDrawLine((Vector *)piVar13[-4],(Vector *)piVar13[-3],piVar13[-2],piVar13[-1],
*piVar13,SUB41(piVar13[1],0),(float)piVar13[2]);
piVar14 = piVar13 + -4;
}
}
}
piVar13 = piVar14;
if (local_44 != 1.0) goto LAB_005600f8;
local_cc = -NAN;
iVar8 = *piVar4;
*piVar14 = (int)piVar4;
pcVar3 = *(code **)(iVar8 + 0xc);
piVar14[-1] = 0x560361;
pfVar10 = (float *)(*pcVar3)();
local_cc = *pfVar10;
piVar14[2] = (int)&local_cc;
piVar14[1] = *(int *)(this + 0x180c);
*piVar14 = (int)(this + 0x1800);
piVar14[-1] = 0x56038b;
CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::InsertBefore
((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
*piVar14,piVar14[1],(CHandle *)piVar14[2]);
iVar11 = iVar11 + 1;
} while (iVar11 < local_1d0[3]);
}
LAB_005603a0:
if (*(int *)(this + 0x180c) != 0) {
if (this[0x17f0] != (CTankClaw)0x1) {
if (this[0x6c] == (CTankClaw)0x0) {
puVar5 = *(uint **)(this + 0x30);
if (puVar5 != (uint *)0x0) {
*puVar5 = *puVar5 | 0x101;
*piVar14 = (int)puVar5;
piVar14[-1] = 0x5603d6;
iVar11 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar14);
*(undefined2 *)(iVar11 + 2) = 0;
}
}
else {
this[0x70] = (CTankClaw)((byte)this[0x70] | 1);
}
this[0x17f0] = (CTankClaw)0x1;
}
pCVar1 = this + 0x17f4;
fVar17 = *(float *)(TankGroundPoundDuration._28_4_ + 0x2c);
*piVar14 = (int)pCVar1;
piVar14[-1] = 0x560403;
lVar15 = (longdouble)CountdownTimer::Now();
if ((float)lVar15 + fVar17 != *(float *)(this + 0x17fc)) {
iVar11 = *(int *)(this + 0x17f4);
*piVar14 = (int)pCVar1;
piVar14[1] = (int)(this + 0x17fc);
pcVar3 = *(code **)(iVar11 + 4);
piVar14[-1] = 0x560936;
(*pcVar3)();
*(float *)(this + 0x17fc) = (float)lVar15 + fVar17;
}
if (fVar17 != *(float *)(this + 0x17f8)) {
iVar11 = *(int *)(this + 0x17f4);
*piVar14 = (int)pCVar1;
piVar14[1] = (int)(this + 0x17f8);
pcVar3 = *(code **)(iVar11 + 4);
piVar14[-1] = 0x560453;
(*pcVar3)();
*(float *)(this + 0x17f8) = fVar17;
}
}
local_1ec = &PTR_EnumElement_00c50470;
*piVar14 = (int)local_1d0;
local_1d0[3] = 0;
piVar14[-1] = 0x560485;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)*piVar14);
iVar11 = local_1d0[0];
*piVar14 = (int)local_1d0;
local_1d0[4] = iVar11;
piVar14[-1] = 0x560499;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)*piVar14);
}
else {
if (this[0x17f0] != (CTankClaw)0x0) {
if (this[0x6c] == (CTankClaw)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar11 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar11 + 2) = 0;
}
}
else {
this[0x70] = (CTankClaw)((byte)this[0x70] | 1);
}
this[0x17f0] = (CTankClaw)0x0;
}
piVar14 = (int *)&stack0xfffffd60;
if (*(float *)(this + 0x17fc) != -1.0) {
(**(code **)(*(int *)(this + 0x17f4) + 4))();
*(undefined4 *)(this + 0x17fc) = 0xbf800000;
piVar14 = (int *)&stack0xfffffd60;
}
}
iVar11 = *(int *)this;
*piVar14 = (int)this;
piVar14[1] = 0xbf;
pcVar3 = *(code **)(iVar11 + 0x3f0);
piVar14[-1] = 0x55fdbc;
(*pcVar3)();
CVar2 = this[0x17f0];
iVar11 = *(int *)this_01;
piVar14[2] = 0;
if (CVar2 == (CTankClaw)0x0) {
*piVar14 = (int)this_01;
piVar14[1] = 0x21;
pcVar3 = *(code **)(iVar11 + 0x7fc);
piVar14[-1] = 0x5604b1;
(*pcVar3)();
return;
}
piVar14[1] = 0x22;
*piVar14 = (int)this_01;
pcVar3 = *(code **)(iVar11 + 0x7fc);
piVar14[-1] = 0x55fdea;
(*pcVar3)();
}
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.