L L4D2node

CCSPlayer::PostThink

0x0065eef0 · 767 bytes · __thiscall

_ZN9CCSPlayer9PostThinkEv

Decompiled

undefined (1 param)

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

void __thiscall CCSPlayer::PostThink(CCSPlayer *this)

{
  CBaseEdict *this_00;
  char cVar1;
  float *pfVar2;
  int iVar3;
  int iVar4;
  float fVar5;
  float fVar6;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  int local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  
  local_2c = 0;
  local_28 = 0;
  if (___atan2f_finite == 0) {
    local_1c = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_2c,0,0,0,0,"/data/src/game/server/cstrike/cs_player.cpp",
               0x65f,&PostThink()::tm_fmt,"(%s)%s","Unaccounted","CCSPlayer::PostThink");
    local_1c = ___atan2f_finite;
  }
  iVar4 = _DAT_0105db00;
  local_24 = local_2c;
  local_20 = local_28;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 0065f0fe to 0065f14c has its CatchHandler @ 0065f20d */
    iVar3 = ThreadGetCurrentId();
    if (iVar4 == iVar3) {
      if ((char *)*_DAT_0105d15c != "CCSPlayer::PostThink") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc6d661,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 0065efa6 to 0065f091 has its CatchHandler @ 0065f222 */
  CBasePlayer::PostThink((CBasePlayer *)this);
  (**(code **)(*(int *)this + 0x888))(this);
  local_14 = *(undefined4 *)(this + 0x3ac);
  local_18 = 0;
  local_10 = *(undefined4 *)(this + 0x3b0);
  CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&local_18);
  pfVar2 = (float *)(**(code **)(*(int *)this + 0x238))(this);
  fVar5 = *pfVar2;
  if (((fVar5 != *(float *)(this + 0x2990)) ||
      (fVar6 = pfVar2[1], fVar6 != *(float *)(this + 0x2994))) ||
     (pfVar2[2] != *(float *)(this + 0x2998))) {
    if (this[0x6c] == (CCSPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
                    /* try { // try from 0065f176 to 0065f17a has its CatchHandler @ 0065f222 */
        iVar4 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar4 + 2) = 0;
        fVar5 = *pfVar2;
      }
    }
    else {
      this[0x70] = (CCSPlayer)((byte)this[0x70] | 1);
      fVar5 = *pfVar2;
    }
    *(float *)(this + 0x2990) = fVar5;
    fVar6 = pfVar2[1];
    *(float *)(this + 0x2994) = fVar6;
    *(float *)(this + 0x2998) = pfVar2[2];
  }
  (**(code **)(**(int **)(this + 0x2910) + 0xc))(*(int **)(this + 0x2910),fVar6,fVar5);
  fVar5 = *(float *)(this + 0x2a08);
  if ((fVar5 != 0.0) &&
     (fVar5 < *(float *)(gpGlobals + 0xc) || fVar5 == *(float *)(gpGlobals + 0xc))) {
                    /* try { // try from 0065f203 to 0065f207 has its CatchHandler @ 0065f222 */
    ApplyDeafnessEffect(this);
  }
  if ((this[0x2084] != (CCSPlayer)0x0) && ((byte)this[0x253] < 3)) {
    CBaseEntity::StopSound((CBaseEntity *)this,"Player.AmbientUnderWater");
    (**(code **)(*(int *)this + 0x6c8))(this,0);
  }
  iVar4 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar3 = ThreadGetCurrentId();
    if (iVar4 == iVar3) {
      cVar1 = CVProfNode::ExitScope();
      if (cVar1 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_1c != 0) {
    (**(code **)(local_1c + 0x54))(local_1c,local_24,local_20,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)