L L4D2node

CDirector::GetTankDamage

0x00878e60 · 480 bytes · __thiscall

_ZNK9CDirector13GetTankDamageEP11CBaseEntity

Decompiled

undefined (2 params)

/* CDirector::GetTankDamage(CBaseEntity*) const */

longdouble __thiscall CDirector::GetTankDamage(CDirector *this,CBaseEntity *param_1)

{
  char cVar1;
  int iVar2;
  longdouble lVar3;
  float fVar4;
  
  if (param_1 == (CBaseEntity *)0x0) goto LAB_00878fb0;
  cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
  if (cVar1 != '\0') {
    iVar2 = CBaseEntity::GetTeamNumber(param_1);
    cVar1 = IsASurvivorTeam(iVar2);
    if ((cVar1 != '\0') && (cVar1 = CTerrorGameRules::HasPlayerControlledZombies(), cVar1 != '\0'))
    {
      lVar3 = (longdouble)GetScriptValue(this,"TankHitDamageModifierVersus",1.0);
      return (longdouble)((float)lVar3 * *(float *)(VersusTankDamage._28_4_ + 0x2c));
    }
    iVar2 = CBaseEntity::GetTeamNumber(param_1);
    cVar1 = IsASurvivorTeam(iVar2);
    if ((((cVar1 == '\0') ||
         (cVar1 = (**(code **)(*(int *)param_1 + 0x7e8))(param_1), cVar1 == '\0')) ||
        (param_1[0x39f1] != (CBaseEntity)0x0)) || (param_1[0x33dc] != (CBaseEntity)0x0)) {
      iVar2 = CBaseEntity::GetTeamNumber(param_1);
      if (iVar2 == 3) {
        return (longdouble)250.0;
      }
    }
    else {
      iVar2 = GetDifficulty();
      if ((-1 < iVar2) && ((fVar4 = 75.0, iVar2 < 3 || (fVar4 = 150.0, iVar2 == 3))))
      goto LAB_00878f41;
    }
    lVar3 = (longdouble)GetScriptValue(this,"TankHitDamageModifierCoop",1.0);
    fVar4 = (float)lVar3;
    iVar2 = GetDifficulty();
    if (iVar2 == 1) {
LAB_00878fa0:
      fVar4 = fVar4 * 24.0;
      goto LAB_00878f41;
    }
    if (iVar2 < 2) {
      if (iVar2 == 0) goto LAB_00878fa0;
    }
    else {
      if (iVar2 == 2) {
        fVar4 = fVar4 * 33.0;
        goto LAB_00878f41;
      }
      if (iVar2 == 3) {
        fVar4 = fVar4 * 100.0;
        goto LAB_00878f41;
      }
    }
  }
  iVar2 = (**(code **)(*(int *)param_1 + 0x144))(param_1);
  if (iVar2 == 0) {
LAB_00878fb0:
    return (longdouble)999.9;
  }
  fVar4 = *(float *)(ZombieWitchHealth._28_4_ + 0x2c);
LAB_00878f41:
  return (longdouble)fVar4;
}

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)