L L4D2node

CTerrorPlayer::UpdateLineOfScrimmage

0x009b3540 · 3287 bytes · __thiscall

_ZN13CTerrorPlayer21UpdateLineOfScrimmageEff

Decompiled

undefined (3 params)

/* CTerrorPlayer::UpdateLineOfScrimmage(float, float) */

void __thiscall
CTerrorPlayer::UpdateLineOfScrimmage(CTerrorPlayer *this,float param_1,float param_2)

{
  float fVar1;
  CBaseEdict *pCVar2;
  float fVar3;
  float fVar4;
  char cVar5;
  bool bVar6;
  int iVar7;
  undefined4 uVar8;
  longdouble lVar9;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  uVar8 = ZombieScrimmageSphere._28_4_;
  if ((*(int *)(this + 0x2c14) != 2) || ((param_1 < 0.0 && (param_2 < 0.0)))) {
    this[0x2ca4] = (CTerrorPlayer)0x0;
    this[0x2cce] = (CTerrorPlayer)0x0;
    if (*(int *)(uVar8 + 0x30) == 0) {
      fVar1 = *(float *)(ZombieScrimmageCreepDelay._28_4_ + 0x2c);
      lVar9 = (longdouble)CountdownTimer::Now();
      if ((float)lVar9 + fVar1 != *(float *)(this + 0x2c28)) {
        (**(code **)(*(int *)(this + 0x2c20) + 4))(this + 0x2c20,this + 0x2c28);
        *(float *)(this + 0x2c28) = (float)lVar9 + fVar1;
      }
      if (fVar1 != *(float *)(this + 0x2c24)) {
        (**(code **)(*(int *)(this + 0x2c20) + 4))(this + 0x2c20,this + 0x2c24);
        *(float *)(this + 0x2c24) = fVar1;
      }
      cVar5 = FindPotentialLineOfScrimmage
                        (this,true,param_1,&local_44,(Vector *)&local_3c,(QAngle *)&local_30);
      if (cVar5 == '\0') {
        iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
        if (iVar7 == 3) {
          uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
          UTIL_LogPrintf("UpdateLineOfScrimmage: %s gets timer\n",uVar8);
        }
        fVar1 = vec3_origin;
        *(undefined4 *)(this + 0x2bc0) = 0;
        *(undefined4 *)(this + 0x2bc4) = 0;
        fVar3 = DAT_01053d4c;
        *(undefined4 *)(this + 0x2be0) = 0;
        *(undefined4 *)(this + 0x2be4) = 0;
        fVar4 = DAT_01053d50;
        if (((fVar1 != *(float *)(this + 0x2be8)) || (fVar3 != *(float *)(this + 0x2bec))) ||
           (DAT_01053d50 != *(float *)(this + 0x2bf0))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2be8) = fVar1;
          *(float *)(this + 0x2bec) = fVar3;
          *(float *)(this + 0x2bf0) = fVar4;
        }
        fVar4 = DAT_01053d44;
        fVar3 = DAT_01053d40;
        fVar1 = vec3_angle;
        if (((vec3_angle != *(float *)(this + 0x2bf4)) ||
            (DAT_01053d40 != *(float *)(this + 0x2bf8))) ||
           (DAT_01053d44 != *(float *)(this + 0x2bfc))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2bf4) = fVar1;
          *(float *)(this + 0x2bf8) = fVar3;
          *(float *)(this + 0x2bfc) = fVar4;
        }
        if (*(int *)(this + 0x2c14) != 0) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(undefined4 *)(this + 0x2c14) = 0;
        }
      }
      else {
        if (*(int *)(this + 0x2c14) != 1) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(undefined4 *)(this + 0x2c14) = 1;
        }
        *(float *)(this + 0x2bc0) = local_44;
        *(float *)(this + 0x2bc4) = local_44;
        if (((local_3c != *(float *)(this + 0x2bc8)) || (local_38 != *(float *)(this + 0x2bcc))) ||
           (local_34 != *(float *)(this + 0x2bd0))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2bc8) = local_3c;
          *(float *)(this + 0x2bcc) = local_38;
          *(float *)(this + 0x2bd0) = local_34;
        }
        if (((local_30 != *(float *)(this + 0x2bd4)) || (local_2c != *(float *)(this + 0x2bd8))) ||
           (local_28 != *(float *)(this + 0x2bdc))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2bd4) = local_30;
          *(float *)(this + 0x2bd8) = local_2c;
          *(float *)(this + 0x2bdc) = local_28;
        }
        fVar1 = *(float *)(this + 0x2bc0);
        uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
        UTIL_LogPrintf("UpdateLineOfScrimmage: %s has a front line of scrimmage of %f flow (wanted %f flow)\n"
                       ,uVar8,(double)fVar1,(double)param_1);
        cVar5 = FindPotentialLineOfScrimmage
                          (this,false,param_2,&local_40,(Vector *)&local_24,(QAngle *)&local_18);
        fVar1 = vec3_origin;
        if (cVar5 == '\0') {
          *(undefined4 *)(this + 0x2be0) = 0;
          fVar4 = DAT_01053d50;
          fVar3 = DAT_01053d4c;
          if (((fVar1 != *(float *)(this + 0x2be8)) || (DAT_01053d4c != *(float *)(this + 0x2bec)))
             || (DAT_01053d50 != *(float *)(this + 0x2bf0))) {
            if (this[0x6c] == (CTerrorPlayer)0x0) {
              pCVar2 = *(CBaseEdict **)(this + 0x30);
              if (pCVar2 != (CBaseEdict *)0x0) {
                *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
                *(undefined2 *)(iVar7 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
            }
            *(float *)(this + 0x2be8) = fVar1;
            *(float *)(this + 0x2bec) = fVar3;
            *(float *)(this + 0x2bf0) = fVar4;
          }
          fVar4 = DAT_01053d44;
          fVar3 = DAT_01053d40;
          fVar1 = vec3_angle;
          if (((vec3_angle != *(float *)(this + 0x2bf4)) ||
              (DAT_01053d40 != *(float *)(this + 0x2bf8))) ||
             (DAT_01053d44 != *(float *)(this + 0x2bfc))) {
            if (this[0x6c] == (CTerrorPlayer)0x0) {
              pCVar2 = *(CBaseEdict **)(this + 0x30);
              if (pCVar2 != (CBaseEdict *)0x0) {
                *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
                *(undefined2 *)(iVar7 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
            }
            *(float *)(this + 0x2bf4) = fVar1;
            *(float *)(this + 0x2bf8) = fVar3;
            *(float *)(this + 0x2bfc) = fVar4;
          }
        }
        else {
          *(float *)(this + 0x2be0) = local_40;
          *(float *)(this + 0x2be4) = local_40;
          if (((local_24 != *(float *)(this + 0x2be8)) || (local_20 != *(float *)(this + 0x2bec)))
             || (local_1c != *(float *)(this + 0x2bf0))) {
            if (this[0x6c] == (CTerrorPlayer)0x0) {
              pCVar2 = *(CBaseEdict **)(this + 0x30);
              if (pCVar2 != (CBaseEdict *)0x0) {
                *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
                *(undefined2 *)(iVar7 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
            }
            *(float *)(this + 0x2be8) = local_24;
            *(float *)(this + 0x2bec) = local_20;
            *(float *)(this + 0x2bf0) = local_1c;
          }
          if (((local_18 != *(float *)(this + 0x2bf4)) || (local_14 != *(float *)(this + 0x2bf8)))
             || (local_10 != *(float *)(this + 0x2bfc))) {
            if (this[0x6c] == (CTerrorPlayer)0x0) {
              pCVar2 = *(CBaseEdict **)(this + 0x30);
              if (pCVar2 != (CBaseEdict *)0x0) {
                *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
                *(undefined2 *)(iVar7 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
            }
            *(float *)(this + 0x2bf4) = local_18;
            *(float *)(this + 0x2bf8) = local_14;
            *(float *)(this + 0x2bfc) = local_10;
          }
        }
        fVar1 = *(float *)(this + 0x2be0);
        uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
        UTIL_LogPrintf("UpdateLineOfScrimmage: %s has a rear line of scrimmage of %f flow (wanted %f flow)\n"
                       ,uVar8,(double)fVar1,(double)param_2);
      }
      iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
      if ((iVar7 != 3) || (iVar7 = TheEscapeRoute(), iVar7 == 0)) {
        iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
        if (iVar7 == 3) {
          uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
          UTIL_LogPrintf("UpdateLineOfScrimmage: %s has no escape route and gets timer\n",uVar8);
        }
        else {
          uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
          UTIL_LogPrintf("UpdateLineOfScrimmage: %s is non-zombie and gets timer\n",uVar8);
        }
        fVar1 = vec3_origin;
        *(undefined4 *)(this + 0x2bc0) = 0;
        *(undefined4 *)(this + 0x2bc4) = 0;
        fVar3 = DAT_01053d4c;
        *(undefined4 *)(this + 0x2be0) = 0;
        *(undefined4 *)(this + 0x2be4) = 0;
        fVar4 = DAT_01053d50;
        if (((fVar1 != *(float *)(this + 0x2be8)) || (fVar3 != *(float *)(this + 0x2bec))) ||
           (DAT_01053d50 != *(float *)(this + 0x2bf0))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2be8) = fVar1;
          *(float *)(this + 0x2bec) = fVar3;
          *(float *)(this + 0x2bf0) = fVar4;
        }
        fVar4 = DAT_01053d44;
        fVar3 = DAT_01053d40;
        fVar1 = vec3_angle;
        if (((vec3_angle != *(float *)(this + 0x2bf4)) ||
            (DAT_01053d40 != *(float *)(this + 0x2bf8))) ||
           (DAT_01053d44 != *(float *)(this + 0x2bfc))) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(float *)(this + 0x2bf4) = fVar1;
          *(float *)(this + 0x2bf8) = fVar3;
          *(float *)(this + 0x2bfc) = fVar4;
        }
        if (*(int *)(this + 0x2c14) != 0) {
          if (this[0x6c] == (CTerrorPlayer)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
          }
          *(undefined4 *)(this + 0x2c14) = 0;
        }
      }
      iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
      if ((iVar7 == 3) && (cVar5 = CDirector::IsFinale(TheDirector), cVar5 == '\0')) {
        local_18 = (float)CONCAT22(local_18._2_2_,0x101);
        bVar6 = ForEachTerrorPlayer<SurvivorsInFinaleScan>((SurvivorsInFinaleScan *)&local_18);
        if ((bVar6) && (local_18._0_1_ == (QAngle)0x0)) {
          uVar8 = (**(code **)(*(int *)this + 0xb8))(this);
          UTIL_LogPrintf("UpdateLineOfScrimmage: %s saw all survivors in the finale area - waiting for finale to start\n"
                         ,uVar8);
          this[0x2cce] = (CTerrorPlayer)0x0;
        }
        else {
          this[0x2cce] = (CTerrorPlayer)0x1;
        }
      }
      UpdateYardLines(this,*(float *)(this + 0x2bc0));
      return;
    }
    iVar7 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if ((((iVar7 == 3) && (iVar7 = TheEscapeRoute(), iVar7 != 0)) &&
        (cVar5 = CDirector::IsFinale(TheDirector), cVar5 == '\0')) &&
       (*(char *)(*(int *)(TheDirector + 0x638) + 0x111) == '\0')) {
      ResizeScrimmageSphere(this);
    }
    else {
      fVar1 = vec3_origin;
      *(undefined4 *)(this + 0x2bc0) = 0;
      *(undefined4 *)(this + 0x2bc4) = 0;
      fVar3 = DAT_01053d4c;
      *(undefined4 *)(this + 0x2be0) = 0;
      *(undefined4 *)(this + 0x2be4) = 0;
      fVar4 = DAT_01053d50;
      if (((fVar1 != *(float *)(this + 0x2be8)) || (fVar3 != *(float *)(this + 0x2bec))) ||
         (DAT_01053d50 != *(float *)(this + 0x2bf0))) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x2be8) = fVar1;
        *(float *)(this + 0x2bec) = fVar3;
        *(float *)(this + 0x2bf0) = fVar4;
      }
      fVar4 = DAT_01053d44;
      fVar3 = DAT_01053d40;
      fVar1 = vec3_angle;
      if (((vec3_angle != *(float *)(this + 0x2bf4)) || (DAT_01053d40 != *(float *)(this + 0x2bf8)))
         || (DAT_01053d44 != *(float *)(this + 0x2bfc))) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x2bf4) = fVar1;
        *(float *)(this + 0x2bf8) = fVar3;
        *(float *)(this + 0x2bfc) = fVar4;
      }
      if (*(int *)(this + 0x2c14) != 0) {
        if (this[0x6c] == (CTerrorPlayer)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar7 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
        }
        *(undefined4 *)(this + 0x2c14) = 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)