L L4D2node

ZombieBotVision::GetMaxVisionRange

0x00a57280 · 334 bytes · __thiscall

_ZNK15ZombieBotVision17GetMaxVisionRangeEv

Decompiled

undefined (1 param)

/* ZombieBotVision::GetMaxVisionRange() const */

longdouble __thiscall ZombieBotVision::GetMaxVisionRange(ZombieBotVision *this)

{
  byte bVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  CBaseEntity *pCVar5;
  float fVar6;
  
  bVar1 = 0;
  piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
  piVar3 = (int *)(**(code **)(*piVar3 + 0xc4))(piVar3);
  if (piVar3 != (int *)0x0) {
    bVar1 = (**(code **)(*piVar3 + 0x114))(piVar3,0);
    bVar1 = bVar1 ^ 1;
  }
  piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
  piVar3 = (int *)(**(code **)(*piVar3 + 0xb4))(piVar3);
  iVar4 = (**(code **)(*piVar3 + 0x52c))(piVar3);
  if ((iVar4 != 0) && ((*(byte *)(iVar4 + 0x12d) & 0x10) != 0)) {
    if (bVar1 == 0) {
      return (longdouble)*(float *)(ZombieVisionRangeObscured._28_4_ + 0x2c);
    }
    fVar6 = *(float *)(ZombieVisionRangeObscuredAlert._28_4_ + 0x2c);
LAB_00a572fd:
    return (longdouble)fVar6;
  }
  cVar2 = IsTimeOfDayBetween(2,4);
  if (cVar2 == '\0') {
    piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
    pCVar5 = (CBaseEntity *)(**(code **)(*piVar3 + 0xb4))(piVar3);
    iVar4 = CBaseEntity::GetGender(pCVar5);
    if (iVar4 != 0x10) {
      piVar3 = (int *)(**(code **)(*(int *)this + 0xb0))(this);
      pCVar5 = (CBaseEntity *)(**(code **)(*piVar3 + 0xb4))(piVar3);
      iVar4 = CBaseEntity::GetGender(pCVar5);
      if (iVar4 != 0x11) {
        if (bVar1 != 0) {
          return (longdouble)*(float *)(ZombieVisionRangeAlert._28_4_ + 0x2c);
        }
        fVar6 = *(float *)(ZombieVisionRange._28_4_ + 0x2c);
        goto LAB_00a572fd;
      }
    }
  }
  return (longdouble)*(float *)(ZombieVisionRangeDaylight._28_4_ + 0x2c);
}

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)