L L4D2node

CL4DGameStats::SurvivorBotNotHelpIncap

0x008df4e0 · 690 bytes · __thiscall

_ZN13CL4DGameStats23SurvivorBotNotHelpIncapEP11SurvivorBotP13CTerrorPlayer

Decompiled

undefined (3 params)

/* CL4DGameStats::SurvivorBotNotHelpIncap(SurvivorBot*, CTerrorPlayer*) */

void __thiscall
CL4DGameStats::SurvivorBotNotHelpIncap
          (CL4DGameStats *this,SurvivorBot *param_1,CTerrorPlayer *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  KeyValues *this_00;
  int iVar7;
  char *pcVar8;
  longdouble lVar9;
  uint in_stack_ffffffb8;
  
  if (((param_1 != (SurvivorBot *)0x0) && (param_2 != (CTerrorPlayer *)0x0)) &&
     ((*(float *)(this + 0x4c8) <= 0.0 ||
      (lVar9 = (longdouble)IntervalTimer::Now(), 120.0 <= (float)lVar9 - *(float *)(this + 0x4c8))))
     ) {
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    fVar1 = *(float *)(param_1 + 0x2e0);
    fVar2 = *(float *)(param_1 + 0x2e4);
    fVar3 = *(float *)(param_1 + 0x2e8);
    if (((byte)param_2[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    fVar4 = *(float *)(param_2 + 0x2e0);
    fVar5 = *(float *)(param_2 + 0x2e4);
    fVar6 = *(float *)(param_2 + 0x2e8);
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffb8);
                    /* try { // try from 008df5e1 to 008df5e5 has its CatchHandler @ 008df79d */
    KeyValues::KeyValues(this_00,"L4D2BotsWontHelp",(IKeyValuesSystem *)0x0,false);
    iVar7 = CSteamWorksGameStatsUploader::GetTimeSinceEpoch();
    KeyValues::SetInt(this_00,"TimeSubmitted",iVar7);
    pcVar8 = "";
    if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
      pcVar8 = *(char **)(gpGlobals + 0x3c);
    }
    KeyValues::SetString(this_00,"MapID",pcVar8);
    iVar7 = CBaseEntity::GetDebugName((CBaseEntity *)param_1);
    if (iVar7 != 0) {
      pcVar8 = (char *)CBaseEntity::GetDebugName((CBaseEntity *)param_1);
      KeyValues::SetString(this_00,"HelperName",pcVar8);
    }
    KeyValues::SetFloat(this_00,"HelperX",fVar1);
    KeyValues::SetFloat(this_00,"HelperY",fVar2);
    KeyValues::SetFloat(this_00,"HelperZ",fVar3);
    iVar7 = CBaseEntity::GetDebugName((CBaseEntity *)param_2);
    if (iVar7 != 0) {
      pcVar8 = (char *)CBaseEntity::GetDebugName((CBaseEntity *)param_2);
      KeyValues::SetString(this_00,"TargetName",pcVar8);
    }
    KeyValues::SetFloat(this_00,"TargetX",fVar4);
    KeyValues::SetFloat(this_00,"TargetY",fVar5);
    KeyValues::SetFloat(this_00,"TargetZ",fVar6);
    lVar9 = (longdouble)IntervalTimer::Now();
    if ((float)lVar9 != *(float *)(this + 0x4c8)) {
      (**(code **)(*(int *)(this + 0x4c4) + 4))(this + 0x4c4,this + 0x4c8);
      *(float *)(this + 0x4c8) = (float)lVar9;
    }
    CSteamWorksGameStatsUploader::AddStatsForUpload(steamGameStats,this_00);
    return;
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)