L L4D2node

CLunge::HandleCustomCollision

0x004d9320 · 551 bytes · __thiscall

_ZN6CLunge21HandleCustomCollisionEP11CBaseEntityRK6VectorS4_P10CGameTraceP9CMoveData

Decompiled

undefined (6 params)

/* CLunge::HandleCustomCollision(CBaseEntity*, Vector const&, Vector const&, CGameTrace*,
   CMoveData*) */

CTerrorPlayer __thiscall
CLunge::HandleCustomCollision
          (CLunge *this,CBaseEntity *param_1,Vector *param_2,Vector *param_3,CGameTrace *param_4,
          CMoveData *param_5)

{
  CTerrorPlayer CVar1;
  CTerrorPlayer *this_00;
  char cVar2;
  int iVar3;
  uint uVar4;
  undefined *puVar5;
  CTakeDamageInfo local_7c [108];
  
  uVar4 = *(uint *)(this + 0x44c);
  if ((((uVar4 != 0xffffffff) &&
       (puVar5 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar5 + 8) == uVar4 >> 0xc)) &&
     ((this_00 = *(CTerrorPlayer **)(puVar5 + 4), this_00 != (CTerrorPlayer *)0x0 &&
      (CVar1 = this_00[0x3e78], CVar1 != (CTerrorPlayer)0x0)))) {
    if ((param_1 != (CBaseEntity *)0x0) &&
       (cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar2 != '\0')) {
      iVar3 = CBaseEntity::GetTeamNumber(param_1);
      cVar2 = IsASurvivorTeam(iVar3);
      if (cVar2 != '\0') {
        if (param_1[0x39f1] != (CBaseEntity)0x0) {
          return (CTerrorPlayer)0x0;
        }
        CTerrorPlayer::OnLungedInto(this_00,(CTerrorPlayer *)param_1);
        if (((byte)param_1[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(param_1);
        }
        *(undefined4 *)(param_5 + 0x9c) = *(undefined4 *)(param_1 + 0x2e0);
        *(undefined4 *)(param_5 + 0xa0) = *(undefined4 *)(param_1 + 0x2e4);
        *(undefined4 *)(param_5 + 0xa4) = *(undefined4 *)(param_1 + 0x2e8);
        if (((byte)param_1[0x14d] & 0x10) != 0) {
          CBaseEntity::CalcAbsoluteVelocity(param_1);
        }
        *(undefined4 *)(param_5 + 0x40) = *(undefined4 *)(param_1 + 0x274);
        *(undefined4 *)(param_5 + 0x44) = *(undefined4 *)(param_1 + 0x278);
        *(undefined4 *)(param_5 + 0x48) = *(undefined4 *)(param_1 + 0x27c);
        return (CTerrorPlayer)0x0;
      }
    }
    if (((this[0x48d] == (CLunge)0x0) &&
        (uVar4 = (**(code **)(*(int *)param_1 + 0xa4))(param_1), (uVar4 & 0x10) != 0)) &&
       ((*(char **)(param_1 + 0x7c) == "prop_door*" ||
        (cVar2 = CBaseEntity::ClassMatchesComplex(param_1,"prop_door*"), cVar2 != '\0')))) {
      this[0x48d] = (CLunge)0x1;
      CTakeDamageInfo::CTakeDamageInfo
                (local_7c,(CBaseEntity *)this_00,(CBaseEntity *)this_00,
                 *(float *)(ZombiePounceDoorDamage._28_4_ + 0x2c),1,0);
      CalculateExplosiveDamageForce(local_7c,param_3,(Vector *)(param_4 + 0xc),1.0);
      for (iVar3 = IPredictionSystem::g_pPredictionSystems; iVar3 != 0; iVar3 = *(int *)(iVar3 + 4))
      {
        *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) + 1;
      }
                    /* try { // try from 004d951a to 004d951e has its CatchHandler @ 004d954d */
      CBaseEntity::TakeDamage(param_1,local_7c);
      for (iVar3 = IPredictionSystem::g_pPredictionSystems; iVar3 != 0; iVar3 = *(int *)(iVar3 + 4))
      {
        *(int *)(iVar3 + 0x10) = *(int *)(iVar3 + 0x10) + -1;
      }
      return CVar1;
    }
  }
  return (CTerrorPlayer)0x0;
}

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)