NextBotPlayer<CTerrorPlayer>::PhysicsSimulate
0x00948bc0 · 2289 bytes · __thiscall
_ZN13NextBotPlayerI13CTerrorPlayerE15PhysicsSimulateEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* NextBotPlayer<CTerrorPlayer>::PhysicsSimulate() */
void __thiscall NextBotPlayer<CTerrorPlayer>::PhysicsSimulate(NextBotPlayer<CTerrorPlayer> *this)
{
INextBot *this_00;
int iVar1;
char cVar2;
int iVar3;
int *piVar4;
int *piVar5;
undefined4 *puVar6;
uint uVar7;
longdouble lVar8;
float local_98;
float local_94;
float local_90;
undefined4 local_8c;
undefined4 local_88;
undefined4 local_80;
undefined4 local_7c;
int local_78;
undefined **local_74;
undefined4 local_70;
undefined4 local_6c;
undefined4 local_68;
undefined4 local_64;
undefined4 local_60;
float local_5c;
float local_58;
float local_54;
uint local_50;
undefined1 local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined2 local_3c;
undefined2 local_3a;
undefined1 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
local_8c = 0;
local_88 = 0;
if (___atan2f_finite == 0) {
local_78 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_8c,0,0,0,0,
"/data/src/game/server/nextbot/player/nextbotplayer.h",0x203,
&PhysicsSimulate()::tm_fmt,"(%s)%s","Unaccounted","NextBotPlayer::PhysicsSimulate");
local_78 = ___atan2f_finite;
}
iVar1 = _DAT_0105db00;
local_80 = local_8c;
local_7c = local_88;
/* try { // try from 00948d1e to 00948d6c has its CatchHandler @ 00949517 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
if ((char *)*_DAT_0105d15c != "NextBotPlayer::PhysicsSimulate") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd08938,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00948c8f to 00948cb9 has its CatchHandler @ 0094951b */
cVar2 = (**(code **)(*engine + 0x148))(engine);
if (((cVar2 == '\0') && (this[0x104] != (NextBotPlayer<CTerrorPlayer>)0x2)) &&
((*(int *)(NextBotStop._28_4_ + 0x30) == 0 && (-1 < *(int *)(this + 0x150))))) {
if (*(int *)(this + 300) != *(int *)(gpGlobals + 0x18)) {
this_00 = (INextBot *)(this + 0x4028);
/* try { // try from 00948df3 to 0094915f has its CatchHandler @ 0094951b */
cVar2 = INextBot::BeginUpdate(this_00);
if (cVar2 == '\0') {
/* try { // try from 009493c1 to 009494b2 has its CatchHandler @ 0094951b */
piVar4 = (int *)(**(code **)(*(int *)(this + 0x4028) + 0xc4))(this_00);
(**(code **)(*piVar4 + 0xa8))(piVar4);
uVar7 = *(uint *)(this + 0x425c) | *(uint *)(this + 0x4260);
}
else {
(**(code **)(*(int *)this + 0x994))(this);
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x426c)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 1;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x4278)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x800;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x4284)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x20;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x4290)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x2000;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x429c)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 8;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42a8)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x10;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42b4)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x200;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42c0)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 0x400;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42cc)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 2;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42d8)) {
*(uint *)(this + 0x425c) = *(uint *)(this + 0x425c) | 4;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42e4)) {
uVar7 = *(uint *)(this + 0x425c) | 0x20000;
*(uint *)(this + 0x425c) = uVar7;
}
else {
uVar7 = *(uint *)(this + 0x425c);
}
*(uint *)(this + 0x4260) = uVar7;
INextBot::EndUpdate();
}
piVar4 = (int *)(**(code **)(*(int *)(this + 0x4028) + 0xc4))(this_00);
piVar5 = (int *)(**(code **)(*(int *)(this + 0x4028) + 0xc0))(this_00);
cVar2 = (**(code **)(*piVar4 + 0x100))(piVar4,1);
local_98 = 0.0;
if (cVar2 != '\0') {
uVar7 = uVar7 | 4;
}
if (((byte)this[0x425c] & 2) != 0) {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_98 = (float)lVar8;
}
if ((uVar7 & 8) == 0) {
local_94 = 0.0;
if ((uVar7 & 0x10) != 0) {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_94 = -(float)lVar8;
}
}
else {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_94 = (float)lVar8;
}
if ((uVar7 & 0x200) == 0) {
local_90 = 0.0;
if ((uVar7 & 0x400) != 0) {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_90 = (float)lVar8;
}
}
else {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_90 = -(float)lVar8;
}
if (*(int *)(NextBotPlayerWalk._28_4_ + 0x30) != 0) {
uVar7 = uVar7 | 0x20000;
}
if (*(int *)(NextBotPlayerCrouch._28_4_ + 0x30) != 0) {
uVar7 = uVar7 | 4;
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x42f0)) {
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_94 = (float)lVar8 * *(float *)(this + 0x42fc);
lVar8 = (longdouble)(**(code **)(*piVar5 + 0x13c))(piVar5);
local_90 = (float)lVar8 * *(float *)(this + 0x4300);
}
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 < *(float *)(this + 0x32dc)) {
uVar7 = uVar7 & 0xfffff9e1;
}
if (*(int *)(NextBotPlayerMove._28_4_ + 0x30) == 0) {
uVar7 = uVar7 & 0xfffff9e5;
local_98 = 0.0;
local_90 = 0.0;
local_94 = 0.0;
}
local_74 = &PTR__CUserCmd_00c15058;
local_70 = 0;
local_6c = 0;
local_68 = 0;
local_64 = 0;
local_60 = 0;
local_5c = 0.0;
local_58 = 0.0;
local_54 = 0.0;
local_50 = 0;
local_4c = 0;
local_48 = 0;
local_44 = 0;
local_40 = 0;
local_3c = 0;
local_3a = 0;
local_38 = 0;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
/* try { // try from 00949248 to 00949333 has its CatchHandler @ 009494ef */
puVar6 = (undefined4 *)(**(code **)(*(int *)this + 0x238))(this);
_V_memset(&local_74,0,0x58);
local_70 = *(undefined4 *)(gpGlobals + 0x18);
local_5c = local_94;
local_58 = local_90;
local_54 = local_98;
local_4c = 0;
local_68 = *puVar6;
local_64 = puVar6[1];
local_60 = puVar6[2];
local_50 = uVar7;
local_40 = (**(code **)(*random_valve + 8))(random_valve,0,0x7fffffff);
CTerrorPlayer::AvoidPlayers((CTerrorPlayer *)this,(CUserCmd *)&local_74);
(**(code **)(*(int *)this + 0x718))(this,&local_74,1,1,0,0);
*(undefined4 *)(this + 0x425c) = 0;
CBasePlayer::PhysicsSimulate((CBasePlayer *)this);
iVar1 = _DAT_0105db00;
local_74 = &PTR__CUserCmd_00c15058;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_78 == 0) {
return;
}
(**(code **)(local_78 + 0x54))(local_78,local_80,local_7c,0,0,0);
return;
}
}
else {
CBasePlayer::PhysicsSimulate((CBasePlayer *)this);
}
iVar1 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar3 = ThreadGetCurrentId(), iVar1 == iVar3)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_78 != 0) {
(**(code **)(local_78 + 0x54))(local_78,local_80,local_7c,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.