L L4D2node

CBaseDoor::Blocked

0x00669030 · 765 bytes · __thiscall

_ZN9CBaseDoor7BlockedEP11CBaseEntity

Decompiled

undefined (2 params)

/* CBaseDoor::Blocked(CBaseEntity*) */

void __thiscall CBaseDoor::Blocked(CBaseDoor *this,CBaseEntity *param_1)

{
  CBaseEntity *this_00;
  int iVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  CTakeDamageInfo local_11c [268];
  
  if (*(float *)(this + 0x504) != 0.0) {
    if ((((this[0x4fa] == (CBaseDoor)0x0) &&
         (0.0 < *(float *)(this + 0x448) || *(float *)(this + 0x448) == 0.0)) ||
        (param_1[0x186] != (CBaseEntity)0x6)) || (1 < (byte)param_1[0x105])) {
      CTakeDamageInfo::CTakeDamageInfo
                (local_11c,(CBaseEntity *)this,(CBaseEntity *)this,*(float *)(this + 0x504),1,0);
      CBaseEntity::TakeDamage(param_1,local_11c);
    }
    else {
      EntityPhysics_CreateSolver((CBaseEntity *)this,param_1,true,4.0);
    }
  }
  if (this[0x4fa] != (CBaseDoor)0x0) {
    return;
  }
  if (0.0 < *(float *)(this + 0x448) || *(float *)(this + 0x448) == 0.0) {
    if (*(int *)(this + 0x440) == 3) {
      DoorGoUp(this);
      iVar3 = *(int *)(this + 0x154);
      goto joined_r0x006690dd;
    }
    DoorGoDown(this);
  }
  iVar3 = *(int *)(this + 0x154);
joined_r0x006690dd:
  if ((iVar3 != 0) && (iVar3 = GetDoorMovementGroup(this,(CBaseDoor **)local_11c,0x40), 0 < iVar3))
  {
    iVar4 = 0;
    do {
      this_00 = *(CBaseEntity **)(local_11c + iVar4 * 4);
      if (0.0 < *(float *)(this_00 + 0x448) || *(float *)(this_00 + 0x448) == 0.0) {
        if (((this[0x4fb] == (CBaseDoor)0x0) ||
            (*(float *)(this + 0x4c4) != *(float *)(this_00 + 0x4c4))) ||
           ((*(float *)(this + 0x4c8) != *(float *)(this_00 + 0x4c8) ||
            (*(float *)(this + 0x4cc) != *(float *)(this_00 + 0x4cc))))) {
LAB_00669258:
          iVar1 = *(int *)(this_00 + 0x440);
        }
        else {
          if (((byte)this[0x14d] & 0x10) != 0) {
            CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
          }
          if (((byte)this_00[0x14d] & 0x10) != 0) {
            CBaseEntity::CalcAbsoluteVelocity(this_00);
          }
          if (((((*(float *)(this + 0x274) != *(float *)(this_00 + 0x274)) ||
                (*(float *)(this + 0x278) != *(float *)(this_00 + 0x278))) ||
               (*(float *)(this + 0x27c) != *(float *)(this_00 + 0x27c))) ||
              ((*(float *)(this + 0x280) != *(float *)(this_00 + 0x280) ||
               (*(float *)(this + 0x284) != *(float *)(this_00 + 0x284))))) ||
             (*(float *)(this + 0x288) != *(float *)(this_00 + 0x288))) goto LAB_00669258;
          *(undefined4 *)(this_00 + 300) = *(undefined4 *)(this + 300);
          cVar2 = (**(code **)(*(int *)this_00 + 0x330))(this_00);
          if (cVar2 != '\0') {
            CBaseEntity::SetLocalAngles(this_00,(QAngle *)(this + 0x3a8));
            CBaseEntity::SetLocalAngularVelocity(this_00,(QAngle *)&vec3_angle);
            goto LAB_00669258;
          }
          CBaseEntity::SetLocalOrigin(this_00,(Vector *)(this + 0x39c));
          CBaseEntity::SetAbsVelocity(this_00,(Vector *)&vec3_origin);
          iVar1 = *(int *)(this_00 + 0x440);
        }
        if (iVar1 == 3) {
          DoorGoUp((CBaseDoor *)this_00);
        }
        else {
          DoorGoDown((CBaseDoor *)this_00);
        }
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 != iVar3);
  }
  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)