CommentarySystem_PePlayerRunCommand
0x0064b0f0 · 2608 bytes · __cdecl
_Z35CommentarySystem_PePlayerRunCommandP11CBasePlayerP8CUserCmd
Decompiled
undefined (2 params)
/* CommentarySystem_PePlayerRunCommand(CBasePlayer*, CUserCmd*) */
void CommentarySystem_PePlayerRunCommand(CBasePlayer *param_1,CUserCmd *param_2)
{
float fVar1;
code *pcVar2;
uint *puVar3;
undefined1 *puVar4;
char cVar5;
IHandleEntity *pIVar6;
int *piVar7;
undefined *puVar8;
undefined4 *puVar9;
undefined4 uVar10;
uint uVar11;
int iVar12;
undefined1 *puVar13;
int *piVar14;
int iVar15;
uint uVar16;
int *piVar17;
uint uVar18;
undefined *local_104;
float local_e8;
float local_e4;
float local_e0;
CTraceFilterSimple local_dc [32];
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;
Vector local_70;
undefined1 local_6f;
undefined1 local_6e;
undefined1 local_6d;
Vector local_64 [64];
int local_24;
if (g_bInCommentaryMode == '\0') {
return;
}
cVar5 = (**(code **)(*(int *)param_1 + 0x5a8))();
if (cVar5 != '\0') {
return;
}
pIVar6 = (IHandleEntity *)GetCommentaryPlayer();
puVar4 = &stack0xfffffec4;
if (pIVar6 == (IHandleEntity *)0x0) {
LAB_0064b7f5:
puVar13 = puVar4;
piVar7 = (int *)0x0;
local_104 = g_pEntityList;
piVar14 = (int *)puVar13;
if (g_CommentarySystem._88_4_ != -1) {
LAB_0064b336:
local_104 = g_pEntityList;
puVar8 = g_pEntityList + (g_CommentarySystem._88_4_ & 0xfff) * 0x10;
piVar14 = (int *)puVar13;
if (puVar8 == (undefined *)0xfffffffc) goto LAB_0064bb3c;
if (*(uint *)(puVar8 + 8) == (uint)g_CommentarySystem._88_4_ >> 0xc) {
piVar17 = *(int **)(puVar8 + 4);
}
else {
piVar17 = (int *)0x0;
}
if (piVar17 != piVar7) {
if ((*(uint *)(puVar8 + 8) == (uint)g_CommentarySystem._88_4_ >> 0xc) &&
(*(int *)(puVar8 + 4) != 0)) {
*(undefined1 *)(*(int *)(puVar8 + 4) + 0x141d) = 0;
}
if (piVar7 != (int *)0x0) goto LAB_0064b379;
g_CommentarySystem._88_4_ = 0xffffffff;
}
}
}
else {
(**(code **)(*(int *)pIVar6 + 0x234))();
(**(code **)(*(int *)pIVar6 + 0x700))();
g_bTracingVsCommentaryNodes = 1;
puVar13 = &stack0xfffffebc;
local_8c = 0;
local_bc = local_e8 * 56755.84;
local_b8 = local_e4 * 56755.84;
local_b4 = local_e0 * 56755.84;
local_94 = 0;
local_98 = 0;
local_9c = 0;
local_a4 = 0;
local_a8 = 0;
local_ac = 0;
local_88 = 1;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,pIVar6,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(&local_70,local_64,0xff,0,0,true,-1.0);
}
g_bTracingVsCommentaryNodes = 0;
puVar4 = &stack0xfffffebc;
if (local_24 == 0) goto LAB_0064b7f5;
piVar7 = (int *)__dynamic_cast();
piVar14 = (int *)&stack0xfffffebc;
if (g_CommentarySystem._88_4_ != -1) goto LAB_0064b336;
LAB_0064bb3c:
local_104 = g_pEntityList;
if (piVar7 != (int *)0x0) {
LAB_0064b379:
*(undefined1 *)((int)piVar7 + 0x141d) = 1;
if (((char)piVar7[0x522] == '\0') &&
(fVar1 = *(float *)(gpGlobals + 0xc), fVar1 != (float)piVar7[0x24])) {
if ((char)piVar7[0x1b] == '\0') {
puVar3 = (uint *)piVar7[0xc];
if (puVar3 != (uint *)0x0) {
*puVar3 = *puVar3 | 0x101;
*piVar14 = (int)puVar3;
piVar14[-1] = 0x64b756;
iVar15 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar14);
*(undefined2 *)(iVar15 + 2) = 0;
}
}
else {
*(byte *)(piVar7 + 0x1c) = *(byte *)(piVar7 + 0x1c) | 1;
}
piVar7[0x24] = (int)fVar1;
}
iVar15 = *piVar7;
*piVar14 = (int)piVar7;
pcVar2 = *(code **)(iVar15 + 0xc);
piVar14[-1] = 0x64b395;
puVar9 = (undefined4 *)(*pcVar2)();
g_CommentarySystem._88_4_ = *puVar9;
local_104 = g_pEntityList;
}
}
uVar16 = *(uint *)(param_2 + 0x24);
uVar11 = (g_CommentarySystem._12_4_ ^ uVar16) & uVar16;
if ((uVar16 & 0x20) == 0) {
g_CommentarySystem._24_4_ = g_CommentarySystem._24_4_ & 0xffffffdf;
}
uVar18 = uVar11 & 0x20;
g_CommentarySystem._12_4_ = uVar16;
if (uVar18 == 0) {
LAB_0064b555:
if (g_CommentarySystem._92_4_ == -1) goto LAB_0064b57e;
piVar7 = (int *)(local_104 + (g_CommentarySystem._92_4_ & 0xfff) * 0x10 + 4);
}
else if ((uVar11 & 0x800) == 0) {
if (g_CommentarySystem._88_4_ != -1) {
uVar11 = g_CommentarySystem._88_4_ & 0xfff;
puVar9 = (undefined4 *)(local_104 + uVar11 * 0x10 + 4);
if (((puVar9 != (undefined4 *)0x0) &&
(*(uint *)(local_104 + uVar11 * 0x10 + 8) == (uint)g_CommentarySystem._88_4_ >> 0xc)) &&
(*(int *)(local_104 + uVar11 * 0x10 + 4) != 0)) {
if (((g_CommentarySystem._92_4_ == -1) ||
(puVar8 = local_104 + (g_CommentarySystem._92_4_ & 0xfff) * 0x10,
puVar8 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar8 + 8) != (uint)g_CommentarySystem._92_4_ >> 0xc ||
(iVar15 = *(int *)(puVar8 + 4), iVar15 == 0)))) goto LAB_0064b866;
if ((*(char *)(iVar15 + 0x141e) == '\0') && (*(char *)(iVar15 + 0x1448) == '\0')) {
if (iVar15 == 0) {
LAB_0064b866:
uVar10 = *puVar9;
}
else {
if (*(int *)(local_104 + uVar11 * 0x10 + 4) != iVar15) {
if (*(char *)(iVar15 + 0x1488) != '\0') {
*piVar14 = iVar15;
piVar14[1] = 1;
piVar14[-1] = 0x64b94a;
CPointCommentaryNode::FinishCommentary
((CPointCommentaryNode *)*piVar14,SUB41(piVar14[1],0));
local_104 = g_pEntityList;
if (g_CommentarySystem._88_4_ != -1) goto LAB_0064b996;
goto LAB_0064b95f;
}
goto LAB_0064b866;
}
LAB_0064b996:
puVar9 = (undefined4 *)(local_104 + (g_CommentarySystem._88_4_ & 0xfff) * 0x10 + 4);
if (puVar9 == (undefined4 *)0x0) {
LAB_0064b95f:
uVar10 = 0;
}
else {
if (puVar9[1] == (uint)g_CommentarySystem._88_4_ >> 0xc) goto LAB_0064b866;
uVar10 = 0;
}
}
*piVar14 = uVar10;
piVar14[-1] = 0x64b870;
CPointCommentaryNode::PlayerActivated((CPointCommentaryNode *)*piVar14);
uVar16 = *(uint *)(param_2 + 0x24);
local_104 = g_pEntityList;
}
goto LAB_0064b540;
}
}
if (g_CommentarySystem._92_4_ == -1) goto LAB_0064b57e;
uVar11 = g_CommentarySystem._92_4_ & 0xfff;
piVar7 = (int *)(local_104 + uVar11 * 0x10 + 4);
if (piVar7 == (int *)0x0) {
piVar7 = (int *)0x0;
}
else if (((*(uint *)(local_104 + uVar11 * 0x10 + 8) == (uint)g_CommentarySystem._92_4_ >> 0xc)
&& (iVar15 = *(int *)(local_104 + uVar11 * 0x10 + 4), iVar15 != 0)) &&
(((uVar11 = *(uint *)(iVar15 + 0x1408), uVar11 != 0xffffffff &&
(((puVar8 = local_104 + (uVar11 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc &&
(*(uint *)(puVar8 + 8) == uVar11 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)))) ||
((((uVar11 = *(uint *)(iVar15 + 0x1414), uVar11 != 0xffffffff &&
(puVar8 = local_104 + (uVar11 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar8 + 8) == uVar11 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)))))) {
if (((*(char *)(iVar15 + 0x141e) == '\0') && (*(char *)(iVar15 + 0x1448) == '\0')) &&
(*(char *)(iVar15 + 0x1488) != '\0')) {
piVar14[1] = 1;
*piVar14 = iVar15;
piVar14[-1] = 0x64bab5;
CPointCommentaryNode::FinishCommentary((CPointCommentaryNode *)*piVar14,SUB41(piVar14[1],0))
;
uVar16 = *(uint *)(param_2 + 0x24);
local_104 = g_pEntityList;
}
uVar16 = uVar16 & 0xffffffdf;
*(uint *)(param_2 + 0x24) = uVar16;
g_CommentarySystem._24_4_ = g_CommentarySystem._24_4_ | uVar18;
goto LAB_0064b555;
}
}
else {
if (g_CommentarySystem._92_4_ == -1) {
LAB_0064b410:
if (((float)g_CommentarySystem._32_4_ < *(float *)(gpGlobals + 0xc) ||
(float)g_CommentarySystem._32_4_ == *(float *)(gpGlobals + 0xc)) &&
(g_CommentarySystem._36_4_ == 0)) {
iVar15 = 0;
if (((g_CommentarySystem._96_4_ != -1) &&
(local_104 = local_104 + (g_CommentarySystem._96_4_ & 0xfff) * 0x10,
local_104 != (undefined *)0xfffffffc)) &&
(*(uint *)(local_104 + 8) == (uint)g_CommentarySystem._96_4_ >> 0xc)) {
iVar15 = *(int *)(local_104 + 4);
}
do {
do {
piVar14[1] = iVar15;
piVar14[2] = (int)"point_commentary_node";
*piVar14 = (int)gEntList;
piVar14[-1] = 0x64b478;
iVar15 = CGlobalEntityList::FindEntityByClassname
((CGlobalEntityList *)*piVar14,(CBaseEntity *)piVar14[1],
(char *)piVar14[2]);
iVar12 = 0;
if (((g_CommentarySystem._96_4_ != -1) &&
(puVar8 = g_pEntityList + (g_CommentarySystem._96_4_ & 0xfff) * 0x10,
puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == (uint)g_CommentarySystem._96_4_ >> 0xc)) {
iVar12 = *(int *)(puVar8 + 4);
}
if (iVar15 == iVar12) goto LAB_0064b537;
} while (iVar15 == 0);
piVar14[3] = 0;
piVar14[2] = (int)&CPointCommentaryNode::typeinfo;
piVar14[1] = (int)&CBaseEntity::typeinfo;
*piVar14 = iVar15;
piVar14[-1] = 0x64b4d8;
piVar7 = (int *)__dynamic_cast();
} while (piVar7 == (int *)0x0);
g_CommentarySystem._36_4_ = 1;
iVar15 = *piVar7;
*piVar14 = (int)piVar7;
pcVar2 = *(code **)(iVar15 + 0xc);
piVar14[-1] = 0x64b4ee;
puVar9 = (undefined4 *)(*pcVar2)();
g_CommentarySystem._96_4_ = *puVar9;
g_CommentarySystem._32_4_ = *(undefined4 *)(gpGlobals + 0xc);
if (((g_CommentarySystem._92_4_ == -1) ||
(puVar8 = g_pEntityList + (g_CommentarySystem._92_4_ & 0xfff) * 0x10,
puVar8 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar8 + 8) != (uint)g_CommentarySystem._92_4_ >> 0xc ||
((iVar15 = *(int *)(puVar8 + 4), iVar15 == 0 || (*(char *)(iVar15 + 0x1488) == '\0')))))
) {
LAB_0064b537:
uVar16 = *(uint *)(param_2 + 0x24);
local_104 = g_pEntityList;
}
else {
*piVar14 = iVar15;
piVar14[1] = 1;
piVar14[-1] = 0x64bb16;
CPointCommentaryNode::FinishCommentary
((CPointCommentaryNode *)*piVar14,SUB41(piVar14[1],0));
uVar16 = *(uint *)(param_2 + 0x24);
local_104 = g_pEntityList;
}
}
LAB_0064b540:
uVar16 = uVar16 & 0xffffffdf;
*(uint *)(param_2 + 0x24) = uVar16;
g_CommentarySystem._24_4_ = g_CommentarySystem._24_4_ | uVar18;
goto LAB_0064b555;
}
uVar11 = g_CommentarySystem._92_4_ & 0xfff;
piVar7 = (int *)(local_104 + uVar11 * 0x10 + 4);
if ((((piVar7 == (int *)0x0) ||
(*(uint *)(local_104 + uVar11 * 0x10 + 8) != (uint)g_CommentarySystem._92_4_ >> 0xc)) ||
(iVar15 = *(int *)(local_104 + uVar11 * 0x10 + 4), iVar15 == 0)) ||
((*(char *)(iVar15 + 0x141e) == '\0' && (*(char *)(iVar15 + 0x1448) == '\0'))))
goto LAB_0064b410;
}
if (((piVar7 != (int *)0x0) && (piVar7[1] == (uint)g_CommentarySystem._92_4_ >> 0xc)) &&
(*piVar7 != 0)) {
*piVar14 = *piVar7;
piVar14[-1] = 0x64b7b2;
cVar5 = CPointCommentaryNode::PreventsMovement((CPointCommentaryNode *)*piVar14);
if (cVar5 != '\0') {
uVar16 = uVar16 & 0xfffff9e1;
*(undefined4 *)(param_2 + 0x20) = 0;
*(undefined4 *)(param_2 + 0x1c) = 0;
*(undefined4 *)(param_2 + 0x18) = 0;
}
}
LAB_0064b57e:
*(uint *)(param_2 + 0x24) = ~g_CommentarySystem._24_4_ & uVar16;
if (g_CommentarySystem._36_4_ == 0) {
return;
}
if (*(float *)(gpGlobals + 0xc) < (float)g_CommentarySystem._32_4_) {
return;
}
if (g_CommentarySystem._36_4_ == 1) {
g_CommentarySystem._36_4_ = 2;
g_CommentarySystem._32_4_ = *(float *)(gpGlobals + 0xc) + 0.35;
piVar14[4] = 0x1a;
}
else {
if (g_CommentarySystem._36_4_ == 2) {
if (((g_CommentarySystem._96_4_ != -1) &&
(local_104 = local_104 + (g_CommentarySystem._96_4_ & 0xfff) * 0x10,
local_104 != (undefined *)0xfffffffc)) &&
((*(uint *)(local_104 + 8) == (uint)g_CommentarySystem._96_4_ >> 0xc &&
(*(int *)(local_104 + 4) != 0)))) {
*piVar14 = *(int *)(local_104 + 4);
piVar14[1] = (int)param_1;
piVar14[-1] = 0x64b989;
CPointCommentaryNode::TeleportTo((CPointCommentaryNode *)*piVar14,(CBasePlayer *)piVar14[1])
;
}
g_CommentarySystem._32_4_ = *(float *)(gpGlobals + 0xc) + 0.6;
g_CommentarySystem._36_4_ = 3;
return;
}
if (g_CommentarySystem._36_4_ != 3) {
return;
}
g_CommentarySystem._36_4_ = 0;
g_CommentarySystem._32_4_ = *(float *)(gpGlobals + 0xc) + 0.25;
piVar14[4] = 0x11;
}
local_6d = 0xff;
local_6e = 0;
local_6f = 0;
local_70 = (Vector)0x0;
piVar14[3] = 0;
piVar14[1] = (int)&local_70;
piVar14[2] = 0x3e99999a;
*piVar14 = (int)param_1;
piVar14[-1] = 0x64b626;
UTIL_ScreenFade((CBaseEntity *)*piVar14,(color32_s *)piVar14[1],(float)piVar14[2],
(float)piVar14[3],piVar14[4]);
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.