L L4D2node

CBaseServerVehicle::ParseEntryExitAnims

0x00b3c570 · 784 bytes · __thiscall

_ZN18CBaseServerVehicle19ParseEntryExitAnimsEv

Decompiled

undefined (1 param)

/* CBaseServerVehicle::ParseEntryExitAnims() */

void __thiscall CBaseServerVehicle::ParseEntryExitAnims(CBaseServerVehicle *this)

{
  code *pcVar1;
  int iVar2;
  char cVar3;
  KeyValues *pKVar4;
  undefined4 uVar5;
  char *pcVar6;
  char *pcVar7;
  KeyValues *pKVar8;
  int iVar9;
  void *pvVar10;
  int iVar11;
  int iVar12;
  uint in_stack_ffffffc8;
  
  pKVar4 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffc8);
                    /* try { // try from 00b3c5a6 to 00b3c5aa has its CatchHandler @ 00b3c89d */
  KeyValues::KeyValues(pKVar4,"",(IKeyValuesSystem *)0x0,false);
  pcVar1 = *(code **)(*modelinfo + 0x54);
  uVar5 = CBaseEntity::GetModel(*(CBaseEntity **)(this + 0x2c));
  pcVar6 = (char *)(*pcVar1)(modelinfo,uVar5);
  pcVar1 = *(code **)(*modelinfo + 0x10);
  uVar5 = CBaseEntity::GetModel(*(CBaseEntity **)(this + 0x2c));
  pcVar7 = (char *)(*pcVar1)(modelinfo,uVar5);
  cVar3 = KeyValues::LoadFromBuffer(pKVar4,pcVar7,pcVar6,(IBaseFileSystem *)0x0,(char *)0x0);
  if (cVar3 != '\0') {
    pKVar8 = (KeyValues *)KeyValues::FindKey(pKVar4,"vehicle_entry",false);
    if (pKVar8 != (KeyValues *)0x0) {
      for (pKVar8 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar8); pKVar8 != (KeyValues *)0x0;
          pKVar8 = (KeyValues *)KeyValues::GetNextKey(pKVar8)) {
        iVar2 = *(int *)(this + 0x4c);
        iVar11 = *(int *)(this + 0x44);
        iVar12 = iVar2 + 1;
        if (iVar11 < iVar12) {
          iVar9 = *(int *)(this + 0x48);
          if (iVar9 < 0) goto LAB_00b3c680;
          if (iVar9 == 0) {
            if (iVar11 == 0) {
              if (iVar12 < 2) {
                iVar9 = 1;
                goto LAB_00b3c737;
              }
              iVar11 = 1;
            }
            do {
              iVar9 = iVar11 * 2;
              if (iVar12 <= iVar9) break;
              iVar9 = iVar11 * 4;
              iVar11 = iVar9;
            } while (iVar9 < iVar12);
          }
          else {
            for (iVar9 = (iVar2 / iVar9 + 1) * iVar9; iVar9 < iVar12; iVar9 = (iVar9 + iVar12) / 2)
            {
            }
          }
LAB_00b3c737:
          *(int *)(this + 0x44) = iVar9;
          if (*(void **)(this + 0x40) == (void *)0x0) {
            pvVar10 = malloc(iVar9 * 0x84);
            *(void **)(this + 0x40) = pvVar10;
            goto LAB_00b3c683;
          }
          pvVar10 = realloc(*(void **)(this + 0x40),iVar9 * 0x84);
          iVar12 = *(int *)(this + 0x4c);
          *(void **)(this + 0x40) = pvVar10;
          *(void **)(this + 0x50) = pvVar10;
          *(int *)(this + 0x4c) = iVar12 + 1;
          iVar12 = (iVar12 + 1) - iVar2;
        }
        else {
LAB_00b3c680:
          pvVar10 = *(void **)(this + 0x40);
LAB_00b3c683:
          *(int *)(this + 0x4c) = iVar12;
          iVar12 = iVar12 - iVar2;
          *(void **)(this + 0x50) = pvVar10;
        }
        if (0 < iVar12 + -1) {
          _V_memmove((void *)((int)pvVar10 + iVar2 * 0x84 + 0x84),
                     (void *)((int)pvVar10 + iVar2 * 0x84),(iVar12 + -1) * 0x84);
        }
        pcVar6 = (char *)KeyValues::GetName(pKVar8);
        V_strncpy((char *)(*(int *)(this + 0x40) + iVar2 * 0x84 + 4),pcVar6,0x80);
        iVar12 = *(int *)(this + 0x40);
        uVar5 = KeyValues::GetInt(pKVar8,(char *)0x0,0);
        *(undefined4 *)(iVar2 * 0x84 + iVar12) = uVar5;
      }
    }
    pKVar8 = (KeyValues *)KeyValues::FindKey(pKVar4,"vehicle_exit",false);
    if (pKVar8 != (KeyValues *)0x0) {
      ParseExitAnim(this,pKVar8,false);
    }
    pKVar8 = (KeyValues *)KeyValues::FindKey(pKVar4,"vehicle_escape_exit",false);
    if (pKVar8 != (KeyValues *)0x0) {
      ParseExitAnim(this,pKVar8,true);
    }
    pKVar4 = (KeyValues *)KeyValues::FindKey(pKVar4,"vehicle_npc_passengers",false);
    if (pKVar4 != (KeyValues *)0x0) {
      ParseNPCRoles(this,pKVar4);
    }
  }
  KeyValues::deleteThis();
  CacheEntryExitPoints(this);
  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)