CTerrorPlayer::PlayerRunCommand
0x009d2160 · 1791 bytes · __thiscall
_ZN13CTerrorPlayer16PlayerRunCommandEP8CUserCmdP11IMoveHelper
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorPlayer::PlayerRunCommand(CUserCmd*, IMoveHelper*) */
void __thiscall
CTerrorPlayer::PlayerRunCommand(CTerrorPlayer *this,CUserCmd *param_1,IMoveHelper *param_2)
{
uint *puVar1;
CTerrorPlayer CVar2;
byte *pbVar3;
code *pcVar4;
char cVar5;
int iVar6;
int *piVar7;
byte *pbVar8;
int *piVar9;
undefined4 uVar10;
uint uVar11;
int iVar12;
longdouble lVar13;
float fVar14;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_towlower == 0) {
local_20 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_34,0,0,0,0,"/data/src/game/server/terror/terrorplayer.cpp",0x706,
&PlayerRunCommand(CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s","ZombieExpensive",
"CTerrorPlayer::PlayerRunCommand");
local_20 = _towlower;
}
iVar6 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 009d23c6 to 009d2426 has its CatchHandler @ 009d28cf */
if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
(iVar12 = ThreadGetCurrentId(), iVar6 != iVar12)) {
if ((*(uint *)(param_1 + 0xc) & 0x7f800000) != 0x7f800000) goto LAB_009d222a;
LAB_009d2441:
*(undefined4 *)(param_1 + 0xc) = vec3_angle;
*(undefined4 *)(param_1 + 0x10) = DAT_01053d40;
*(undefined4 *)(param_1 + 0x14) = DAT_01053d44;
if ((*(uint *)(param_1 + 0x18) & 0x7f800000) == 0x7f800000) goto LAB_009d247b;
LAB_009d2263:
if ((*(uint *)(param_1 + 0x1c) & 0x7f800000) != 0x7f800000) goto LAB_009d2276;
LAB_009d2495:
uVar11 = *(uint *)(param_1 + 0x20);
*(undefined4 *)(param_1 + 0x1c) = 0;
}
else {
if ((char *)*_DAT_0105d15c != "CTerrorPlayer::PlayerRunCommand") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd19890,(char *)0x0,0xd15c86);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
if ((*(uint *)(param_1 + 0xc) & 0x7f800000) == 0x7f800000) goto LAB_009d2441;
LAB_009d222a:
if (((*(uint *)(param_1 + 0x10) & 0x7f800000) == 0x7f800000) ||
((*(uint *)(param_1 + 0x14) & 0x7f800000) == 0x7f800000)) goto LAB_009d2441;
if ((*(uint *)(param_1 + 0x18) & 0x7f800000) != 0x7f800000) goto LAB_009d2263;
LAB_009d247b:
*(undefined4 *)(param_1 + 0x18) = 0;
if ((*(uint *)(param_1 + 0x1c) & 0x7f800000) == 0x7f800000) goto LAB_009d2495;
LAB_009d2276:
uVar11 = *(uint *)(param_1 + 0x20);
}
if ((uVar11 & 0x7f800000) == 0x7f800000) {
*(undefined4 *)(param_1 + 0x20) = 0;
}
uVar11 = *(int *)(bot_mimic._28_4_ + 0x30) >> 0x1f;
iVar6 = (*(uint *)(bot_mimic._28_4_ + 0x30) ^ uVar11) - uVar11;
if (*(int *)(gpGlobals + 0x14) < iVar6) goto LAB_009d2300;
if (*(int *)(this + 0x30) == 0) {
iVar12 = 0;
}
else {
iVar12 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 009d22c2 to 009d2347 has its CatchHandler @ 009d28ae */
if ((iVar6 == iVar12) || (piVar7 = (int *)UTIL_PlayerByIndex(iVar6), piVar7 == (int *)0x0))
goto LAB_009d2300;
iVar6 = TheNextBots();
if (*(int *)(iVar6 + 0x4c) != 0) {
iVar6 = TheNextBots();
cVar5 = (**(code **)(**(int **)(iVar6 + 0x4c) + 0xe0))(*(int **)(iVar6 + 0x4c),this);
if (cVar5 == '\0') goto LAB_009d2300;
}
if (param_1 == (CUserCmd *)(piVar7 + 0x7e3)) {
fVar14 = *(float *)(param_1 + 0x10);
uVar11 = *(uint *)(param_1 + 0x2c);
}
else {
*(int *)(param_1 + 4) = piVar7[0x7e4];
*(int *)(param_1 + 8) = piVar7[0x7e5];
*(int *)(param_1 + 0xc) = piVar7[0x7e6];
fVar14 = (float)piVar7[0x7e7];
*(float *)(param_1 + 0x10) = fVar14;
*(int *)(param_1 + 0x14) = piVar7[0x7e8];
*(int *)(param_1 + 0x18) = piVar7[0x7e9];
*(int *)(param_1 + 0x1c) = piVar7[0x7ea];
*(int *)(param_1 + 0x20) = piVar7[0x7eb];
*(int *)(param_1 + 0x24) = piVar7[0x7ec];
param_1[0x28] = *(CUserCmd *)(piVar7 + 0x7ed);
uVar11 = piVar7[0x7ee];
*(uint *)(param_1 + 0x2c) = uVar11;
*(int *)(param_1 + 0x30) = piVar7[0x7ef];
*(int *)(param_1 + 0x34) = piVar7[0x7f0];
*(short *)(param_1 + 0x38) = (short)piVar7[0x7f1];
*(undefined2 *)(param_1 + 0x3a) = *(undefined2 *)((int)piVar7 + 0x1fc6);
param_1[0x3c] = *(CUserCmd *)(piVar7 + 0x7f2);
*(int *)(param_1 + 0x40) = piVar7[0x7f3];
*(int *)(param_1 + 0x44) = piVar7[0x7f4];
*(int *)(param_1 + 0x48) = piVar7[0x7f5];
*(int *)(param_1 + 0x4c) = piVar7[0x7f6];
*(int *)(param_1 + 0x50) = piVar7[0x7f7];
*(int *)(param_1 + 0x54) = piVar7[0x7f8];
}
*(float *)(param_1 + 0x10) = fVar14 + *(float *)(bot_mimic_yaw_offset._28_4_ + 0x2c);
if (uVar11 != 0) {
if (uVar11 < 0x800) {
pbVar3 = *(byte **)(gpGlobals + 0x58);
if (pbVar3 != (byte *)0x0) {
pbVar8 = pbVar3 + uVar11 * 0x10;
if ((*pbVar8 & 2) != 0) goto LAB_009d2858;
LAB_009d2754:
piVar9 = *(int **)(pbVar8 + 0xc);
if ((piVar9 != (int *)0x0) &&
(piVar9 = (int *)(**(code **)(*piVar9 + 0x18))(piVar9), piVar9 != (int *)0x0)) {
pcVar4 = *(code **)(*(int *)this + 0x484);
uVar10 = (**(code **)(*piVar9 + 0x530))(piVar9);
iVar6 = (*pcVar4)(this,uVar10);
if (iVar6 == 0) {
*(undefined4 *)(param_1 + 0x2c) = 0;
}
else {
if (*(int *)(iVar6 + 0x30) == 0) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(iVar6 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
*(int *)(param_1 + 0x2c) = iVar6;
}
}
}
}
else {
pbVar3 = *(byte **)(gpGlobals + 0x58);
if (*(byte **)(gpGlobals + 0x58) != (byte *)0x0) {
LAB_009d2858:
pbVar8 = pbVar3;
if ((*pbVar8 & 2) == 0) goto LAB_009d2754;
}
}
}
iVar6 = (**(code **)(*piVar7 + 0x5f4))(piVar7);
if ((iVar6 == 0) || (iVar6 = (**(code **)(*(int *)this + 0x5f4))(this), iVar6 != 0)) {
iVar6 = (**(code **)(*piVar7 + 0x5f4))(piVar7);
if ((iVar6 == 0) && (iVar6 = (**(code **)(*(int *)this + 0x5f4))(this), iVar6 != 0)) {
(**(code **)(*(int *)this + 0x5fc))(this,1);
}
}
else {
(**(code **)(*(int *)this + 0x5f8))(this,1);
}
*(undefined4 *)(this + 0x1c94) = 0;
LAB_009d2300:
cVar5 = (**(code **)(*(int *)this + 0x7e8))(this);
if (cVar5 != '\0') {
iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
uVar11 = *(uint *)(param_1 + 0x24);
if (iVar6 == 3) {
uVar11 = uVar11 & 0xfffffffe;
*(uint *)(param_1 + 0x24) = uVar11;
}
if ((uVar11 & 1) != 0) {
OnIncapacitatedAttack(this);
uVar11 = *(uint *)(param_1 + 0x24);
}
*(undefined4 *)(param_1 + 0x20) = 0;
*(undefined4 *)(param_1 + 0x1c) = 0;
if ((this[0x39f1] == (CTerrorPlayer)0x0) || (this[0x3a2c] == (CTerrorPlayer)0x0)) {
*(uint *)(param_1 + 0x24) = uVar11 & 0xfffff1cd;
cVar5 = CanCrawl();
if (cVar5 == '\0') {
*(uint *)(param_1 + 0x24) = *(uint *)(param_1 + 0x24) & 0xfffffff7;
*(undefined4 *)(param_1 + 0x18) = 0;
}
}
else {
*(uint *)(param_1 + 0x24) = uVar11 & 0xfffff1c7;
}
}
if (((this[0x33bd] != (CTerrorPlayer)0x0) && ((*(uint *)(param_1 + 0x24) & 0xe3a) != 0)) &&
((*(float *)(this + 0x33b8) <= 0.0 ||
(lVar13 = (longdouble)IntervalTimer::Now(), 1.0 < (float)lVar13 - *(float *)(this + 0x33b8))))
) {
CBasePlayer::ClearUseEntity((CBasePlayer *)this);
}
CVar2 = this[0x186];
CCSPlayer::PlayerRunCommand((CCSPlayer *)this,param_1,param_2);
if ((CVar2 == (CTerrorPlayer)0x9) || (this[0x186] != (CTerrorPlayer)0x9)) {
if ((this[0x186] != (CTerrorPlayer)0x9) && (CVar2 == (CTerrorPlayer)0x9)) {
/* try { // try from 009d2515 to 009d2895 has its CatchHandler @ 009d28ae */
OnLadderDismount(this);
}
}
else {
OnLadderMount(this);
}
iVar6 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar12 = ThreadGetCurrentId(), iVar6 == iVar12)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
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.