SurvivorLegsMeetRescueVehicleArrival::Update
0x00954de0 · 1913 bytes · __thiscall
_ZN36SurvivorLegsMeetRescueVehicleArrival6UpdateEP11SurvivorBotf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SurvivorLegsMeetRescueVehicleArrival::Update(SurvivorBot*, float) */
SurvivorLegsMeetRescueVehicleArrival * __thiscall
SurvivorLegsMeetRescueVehicleArrival::Update
(SurvivorLegsMeetRescueVehicleArrival *this,SurvivorBot *param_1,float param_2)
{
Vector *pVVar1;
INextBot *pIVar2;
uint *puVar3;
CNavArea CVar4;
char cVar5;
bool bVar6;
int *piVar7;
int iVar8;
int iVar9;
Vector *pVVar10;
CNavArea *pCVar11;
CNavArea *pCVar12;
CBaseEntity *pCVar13;
undefined4 *puVar14;
int iVar15;
undefined4 uVar16;
SurvivorBot *pSVar17;
longdouble lVar18;
Path *local_74;
CNavArea *local_60;
undefined4 local_5c;
undefined4 local_58;
undefined4 local_50;
undefined4 local_4c;
int local_48;
float local_44;
float local_40;
float local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined **local_2c;
INextBot *local_28;
undefined4 local_24;
undefined1 local_20;
undefined1 local_1f;
cVar5 = CDirector::IsFinale(TheDirector);
if ((cVar5 != '\0') && (cVar5 = CDirector::IsFinaleVehicleReady(TheDirector), cVar5 != '\0')) {
puVar14 = ::operator_new(0x4814);
puVar14[8] = 0;
puVar14[9] = 0;
puVar14[10] = 0;
puVar14[3] = 0;
puVar14[4] = 0;
puVar14[5] = 0;
puVar14[6] = 0;
puVar14[7] = 0;
puVar14[2] = 0;
*(undefined1 *)(puVar14 + 0xc) = 0;
*(undefined1 *)((int)puVar14 + 0x31) = 0;
puVar14[0xb] = 0;
*puVar14 = &PTR__SurvivorLegsEnterRescueVehicle_00d0b388;
puVar14[1] = &PTR__SurvivorLegsEnterRescueVehicle_00d0b4f0;
/* try { // try from 0095524d to 00955251 has its CatchHandler @ 0095556c */
PathFollower::PathFollower((PathFollower *)(puVar14 + 0xd));
*(undefined4 *)this = 1;
*(undefined4 **)(this + 4) = puVar14;
*(char **)(this + 8) = "The rescue vehicle is here!!!";
return this;
}
if (*(int *)(param_1 + 0x4814) == 0) {
uVar16 = (**(code **)(*(int *)param_2 + 0x9b8))(param_2);
DevMsg("%3.2f: %s ERROR: No RESCUE_VEHICLE area!\n",(double)*(float *)(gpGlobals + 0xc),uVar16);
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
pIVar2 = (INextBot *)((int)param_2 + 0x4028);
cVar5 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x118))
(pIVar2,*(int *)(param_1 + 0x4814) + 0x2c);
if (cVar5 != '\0') goto LAB_00954eb4;
if ((0 < *(int *)(param_1 + 0x4438)) && (0.0 < *(float *)(param_1 + 0x4480))) {
lVar18 = (longdouble)IntervalTimer::Now();
if ((float)lVar18 - *(float *)(param_1 + 0x4480) < 3.0) {
PathFollower::Update((PathFollower *)(param_1 + 0x34),pIVar2);
goto LAB_00954eb4;
}
}
local_74 = (Path *)(param_1 + 0x34);
local_2c = &PTR_operator___00d09770;
local_28 = pIVar2;
local_24 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))(pIVar2);
piVar7 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 200))(pIVar2);
iVar8 = (**(code **)(*piVar7 + 0xb8))(piVar7,pIVar2);
local_1f = 0;
local_20 = iVar8 != 0;
local_5c = 0;
local_58 = 0;
iVar8 = *(int *)(param_1 + 0x4814);
if (_towlower == 0) {
local_48 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_5c,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",0x113,
&Path::
Compute<SurvivorBotPathCost>(INextBot*,Vector_const&,SurvivorBotPathCost&,float)::
tm_fmt,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
local_48 = _towlower;
}
iVar15 = _DAT_0105db00;
local_50 = local_5c;
local_4c = local_58;
/* try { // try from 00954fe2 to 00954fe6 has its CatchHandler @ 00955586 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar9 = ThreadGetCurrentId(), iVar15 == iVar9)) {
if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
/* try { // try from 009554c2 to 009554e5 has its CatchHandler @ 00955586 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
}
puVar3 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar3 = *puVar3 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00954ffb to 0095516d has its CatchHandler @ 0095559b */
(**(code **)(*(int *)(param_1 + 0x34) + 0x48))(local_74);
pVVar10 = (Vector *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xd4))(pIVar2);
piVar7 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
pCVar11 = (CNavArea *)(**(code **)(*piVar7 + 0x52c))(piVar7);
if (pCVar11 == (CNavArea *)0x0) {
/* try { // try from 0095553c to 00955566 has its CatchHandler @ 0095559b */
(**(code **)(*(int *)(param_1 + 0x34) + 100))(local_74,pIVar2,2);
}
else {
pVVar1 = (Vector *)(iVar8 + 0x2c);
pCVar12 = (CNavArea *)CNavMesh::GetNearestNavArea(TheNavMesh,pVVar1,true,200.0,true,true,false);
if (pCVar11 == pCVar12) {
LAB_00955474:
Path::BuildTrivialPath(local_74,pIVar2,pVVar1);
}
else {
local_44 = *(float *)(iVar8 + 0x2c);
local_40 = *(float *)(iVar8 + 0x30);
local_3c = *(float *)(iVar8 + 0x34);
if (pCVar12 == (CNavArea *)0x0) {
CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_44,&local_3c,(Vector *)0x0);
}
else {
lVar18 = (longdouble)CNavArea::GetZ(pCVar12,local_44,local_40);
local_3c = (float)lVar18;
}
pCVar13 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
if (((byte)pCVar13[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar13);
}
local_38 = *(undefined4 *)(pCVar13 + 0x2e0);
local_60 = (CNavArea *)0x0;
local_34 = *(undefined4 *)(pCVar13 + 0x2e4);
local_30 = *(undefined4 *)(pCVar13 + 0x2e8);
pCVar13 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xb4))(pIVar2);
iVar8 = CBaseEntity::GetTeamNumber(pCVar13);
bVar6 = NavAreaBuildPath<SurvivorBotPathCost>
(pCVar11,pCVar12,(Vector *)&local_38,pVVar1,(SurvivorBotPathCost *)&local_2c
,&local_60,0.0,iVar8,false);
if (local_60 != (CNavArea *)0x0) {
if (pCVar11 == local_60) goto LAB_00955474;
iVar8 = 1;
pCVar12 = local_60;
do {
pCVar12 = *(CNavArea **)(pCVar12 + 0x78);
if (pCVar12 == (CNavArea *)0x0) break;
iVar8 = iVar8 + 1;
} while (pCVar11 != pCVar12);
if (iVar8 < 0x100) {
if (iVar8 == 1) goto LAB_00955474;
*(int *)(param_1 + 0x4438) = iVar8;
}
else {
iVar8 = 0xff;
*(undefined4 *)(param_1 + 0x4438) = 0xff;
}
iVar15 = iVar8;
pSVar17 = param_1 + (iVar8 + -1) * 0x44 + 0x38;
pCVar11 = local_60;
do {
*(CNavArea **)pSVar17 = pCVar11;
iVar15 = iVar15 + -1;
CVar4 = pCVar11[0x7c];
*(undefined4 *)(pSVar17 + 0x18) = 0;
*(uint *)(pSVar17 + 4) = (byte)CVar4 & 0xf;
pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
if (pCVar11 == (CNavArea *)0x0) break;
pSVar17 = pSVar17 + -0x44;
} while (iVar15 != 0);
iVar8 = iVar8 * 0x44;
*(CNavArea **)(param_1 + iVar8 + 0x38) = local_60;
*(float *)(local_74 + iVar8 + 0xc) = local_44;
*(float *)(local_74 + iVar8 + 0x10) = local_40;
*(float *)(local_74 + iVar8 + 0x14) = local_3c;
iVar8 = *(int *)(param_1 + 0x4438);
*(undefined4 *)(param_1 + iVar8 * 0x44 + 0x4c) = 0;
*(undefined4 *)(param_1 + iVar8 * 0x44 + 0x3c) = 9;
*(undefined4 *)(param_1 + iVar8 * 0x44 + 0x50) = 0;
*(int *)(param_1 + 0x4438) = iVar8 + 1;
/* try { // try from 0095534f to 00955385 has its CatchHandler @ 0095559b */
cVar5 = Path::ComputePathDetails(local_74,pIVar2,pVVar10);
if (cVar5 == '\0') {
(**(code **)(*(int *)(param_1 + 0x34) + 0x48))(local_74);
(**(code **)(*(int *)(param_1 + 0x34) + 100))(local_74,pIVar2,2);
}
else {
/* try { // try from 00955444 to 0095548c has its CatchHandler @ 0095559b */
Path::Optimize((INextBot *)local_74);
Path::PostProcess(local_74);
(**(code **)(*(int *)(param_1 + 0x34) + 100))(local_74,pIVar2,!bVar6);
}
}
}
}
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar15 = ThreadGetCurrentId(), iVar8 == iVar15)) {
cVar5 = CVProfNode::ExitScope();
if (cVar5 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_48 != 0) {
(**(code **)(local_48 + 0x54))(local_48,local_50,local_4c,0,0,0);
}
LAB_00954eb4:
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
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.