L L4D2node

CBaseEntity::PhysicsCustom

0x0078f0d0 · 1260 bytes · __thiscall

_ZN11CBaseEntity13PhysicsCustomEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseEntity::PhysicsCustom() */

void __thiscall CBaseEntity::PhysicsCustom(CBaseEntity *this)

{
  byte bVar1;
  char cVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  CBaseEntity *this_00;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  int local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  float local_7c;
  float local_78;
  float local_74;
  CGameTrace local_70 [54];
  char local_3a;
  
  local_c4 = 0;
  local_c0 = 0;
  if (___atan2f_finite == 0) {
    local_b0 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_c4,0,0,0,0,"/data/src/game/server/physics_main.cpp",0x64d,
               &PhysicsCustom()::tm_fmt,"(%s)%s","Unaccounted","CBaseEntity::PhysicsCustom");
    local_b0 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_b8 = local_c4;
  local_b4 = local_c0;
                    /* try { // try from 0078f3ce to 0078f41c has its CatchHandler @ 0078f613 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    if ((char *)*_DAT_0105d15c != "CBaseEntity::PhysicsCustom") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcb200a,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 0078f1a2 to 0078f2e6 has its CatchHandler @ 0078f5ef */
  PhysicsCheckWater(this);
  cVar2 = PhysicsRunThink(this,0);
  if (cVar2 == '\0') goto LAB_0078f360;
  if ((0.0 < *(float *)(this + 0x2f4)) || (iVar5 = GetGroundEntity(this), iVar5 == 0)) {
LAB_0078f1cf:
    SetGroundEntity(this,(CBaseEntity *)0x0);
  }
  else {
    this_00 = (CBaseEntity *)GetGroundEntity(this);
    cVar2 = IsStandable(this_00);
    if (cVar2 == '\0') goto LAB_0078f1cf;
  }
  uVar3 = *(uint *)(this + 0x14c);
  if ((uVar3 & 0x800) != 0) {
    CalcAbsolutePosition(this);
    uVar3 = *(uint *)(this + 0x14c);
  }
  local_ac = *(float *)(this + 0x2e0);
  local_a8 = *(float *)(this + 0x2e4);
  local_a4 = *(float *)(this + 0x2e8);
  if ((uVar3 & 0x1000) != 0) {
    CalcAbsoluteVelocity(this);
    uVar3 = *(uint *)(this + 0x14c);
  }
  local_a0 = *(undefined4 *)(this + 0x274);
  local_9c = *(undefined4 *)(this + 0x278);
  local_98 = *(undefined4 *)(this + 0x27c);
  if ((uVar3 & 0x800) != 0) {
                    /* try { // try from 0078f47b to 0078f507 has its CatchHandler @ 0078f5ef */
    CalcAbsolutePosition(this);
  }
  local_94 = *(undefined4 *)(this + 0x37c);
  local_90 = *(undefined4 *)(this + 0x380);
  local_8c = *(undefined4 *)(this + 900);
  local_88 = *(undefined4 *)(this + 0x280);
  local_84 = *(undefined4 *)(this + 0x284);
  local_80 = *(undefined4 *)(this + 0x288);
  (**(code **)(*(int *)this + 0x2d0))
            (this,&local_ac,(Vector *)&local_a0,(QAngle *)&local_94,&local_88);
  SetAbsVelocity(this,(Vector *)&local_a0);
  SetAbsAngles(this,(QAngle *)&local_94);
  SetLocalAngularVelocity(this,(QAngle *)&local_88);
  if (((byte)this[0x14d] & 8) != 0) {
                    /* try { // try from 0078f583 to 0078f5af has its CatchHandler @ 0078f5ef */
    CalcAbsolutePosition(this);
  }
  local_7c = local_ac - *(float *)(this + 0x2e0);
  local_74 = local_a4 - *(float *)(this + 0x2e8);
  local_78 = local_a8 - *(float *)(this + 0x2e4);
  if (1e-06 < local_7c * local_7c + local_74 * local_74 + local_78 * local_78) {
    PhysicsPushEntity(this,(Vector *)&local_7c,local_70);
    PhysicsCheckVelocity(this);
    if (local_3a != '\0') goto LAB_0078f360;
    bVar1 = **(byte **)(this + 0x30);
  }
  else {
    bVar1 = **(byte **)(this + 0x30);
  }
  if ((bVar1 & 2) == 0) {
    PhysicsCheckWaterTransition(this);
    iVar5 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_b0 == 0) {
      return;
    }
    (**(code **)(local_b0 + 0x54))(local_b0,local_b8,local_b4,0,0,0);
    return;
  }
LAB_0078f360:
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_b0 != 0) {
    (**(code **)(local_b0 + 0x54))(local_b0,local_b8,local_b4,0,0,0);
  }
  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)