L L4D2node

CDirector::TryOfferingTankBot

0x00872af0 · 663 bytes · __thiscall

_ZN9CDirector18TryOfferingTankBotEP11CBaseEntityb

Decompiled

undefined (3 params)

/* CDirector::TryOfferingTankBot(CBaseEntity*, bool) */

void __thiscall CDirector::TryOfferingTankBot(CDirector *this,CBaseEntity *param_1,bool param_2)

{
  float fVar1;
  char cVar2;
  CBaseEntity *this_00;
  int iVar3;
  int iVar4;
  longdouble lVar5;
  int local_28;
  
  if (((param_1 == (CBaseEntity *)0x0) || (0.0 < *(float *)(this + 0x270))) ||
     ((**(int **)(TheDirector + 0x638) != 5 && (*(int *)(TheDirector + 0x164) == 3)))) {
    return;
  }
  if (*(int *)(gpGlobals + 0x14) < 1) {
    SetLotteryTank(this,param_1,param_2);
    if (*(int *)(tank_raffle_debug._28_4_ + 0x30) == 0) {
LAB_00872c86:
      UTIL_LogPrintf("Tank offer: making a bot, and giving him to nobody\n");
      ReleaseLotteryTank(this);
      return;
    }
  }
  else {
    iVar4 = 1;
    local_28 = 0;
    do {
      this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar4);
      if (((((this_00 != (CBaseEntity *)0x0) &&
            (cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar2 != '\0')) &&
           (*(int *)(this_00 + 0x30) != 0)) &&
          ((*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0 &&
           (iVar3 = CBaseEntity::GetTeamNumber(this_00), iVar3 == 3)))) &&
         (cVar2 = (**(code **)(*(int *)this_00 + 0x778))(this_00), cVar2 == '\0')) {
        local_28 = local_28 + 1;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 <= *(int *)(gpGlobals + 0x14));
    SetLotteryTank(this,param_1,param_2);
    if ((local_28 < 2) && (*(int *)(tank_raffle_debug._28_4_ + 0x30) == 0)) {
      if (local_28 != 1) goto LAB_00872c86;
      lVar5 = (longdouble)CountdownTimer::Now();
      if ((float)lVar5 + 0.01 != *(float *)(this + 0x180)) {
        (**(code **)(*(int *)(this + 0x178) + 4))(this + 0x178,this + 0x180);
        *(float *)(this + 0x180) = (float)lVar5 + 0.01;
      }
      if (*(float *)(this + 0x17c) != 0.01) {
        (**(code **)(*(int *)(this + 0x178) + 4))(this + 0x178,this + 0x17c);
        *(undefined4 *)(this + 0x17c) = 0x3c23d70a;
      }
      this = (CDirector *)s_Tank_offer__Going_to_the_only_PZ_00cdd640;
      goto LAB_00872c16;
    }
  }
  fVar1 = *(float *)(DirectorTankLotteryEntryTime._28_4_ + 0x2c);
  lVar5 = (longdouble)CountdownTimer::Now();
  if ((float)lVar5 + fVar1 != *(float *)(this + 0x180)) {
    (**(code **)(*(int *)(this + 0x178) + 4))(this + 0x178,this + 0x180);
    *(float *)(this + 0x180) = (float)lVar5 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x17c)) {
    (**(code **)(*(int *)(this + 0x178) + 4))(this + 0x178,this + 0x17c);
    *(float *)(this + 0x17c) = fVar1;
  }
  this = (CDirector *)s_Tank_offer__Starting_the_lottery_00cdd61c;
LAB_00872c16:
  UTIL_LogPrintf((char *)this);
  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)