L L4D2node

CPropData::GetRandomChunkModel

0x00498d60 · 207 bytes · __thiscall

_ZN9CPropData19GetRandomChunkModelEPKci

Decompiled

undefined (3 params)

/* CPropData::GetRandomChunkModel(char const*, int) */

undefined1 * __thiscall CPropData::GetRandomChunkModel(CPropData *this,char *param_1,int param_2)

{
  size_t sVar1;
  int iVar2;
  int iVar3;
  undefined1 *puVar4;
  char *pcVar5;
  int iVar6;
  int local_20;
  
  if (this[0x10] != (CPropData)0x0) {
    iVar3 = *(int *)(this + 0x20);
    if (iVar3 < 1) {
      if (iVar3 != 0) {
        local_20 = 0;
LAB_00498dd5:
        iVar3 = *(int *)(*(int *)(this + 0x14) + 0x10 + local_20) + -1;
        if ((param_2 != -1) && (param_2 < iVar3)) {
          iVar3 = param_2;
        }
        iVar3 = RandomInt(0,iVar3);
        puVar4 = *(undefined1 **)(*(int *)(*(int *)(this + 0x14) + 4 + local_20) + iVar3 * 4);
        if (puVar4 == (undefined1 *)0x0) {
          puVar4 = &DAT_00d539c2;
        }
        return puVar4;
      }
    }
    else {
      iVar6 = 0;
      do {
        sVar1 = strlen(param_1);
        local_20 = iVar6 * 0x18;
        pcVar5 = *(char **)(*(int *)(this + 0x14) + iVar6 * 0x18);
        if (pcVar5 == (char *)0x0) {
          pcVar5 = "";
        }
        iVar2 = V_strncmp(pcVar5,param_1,sVar1);
        if (iVar2 == 0) goto LAB_00498dd5;
        iVar6 = iVar6 + 1;
      } while (iVar6 != iVar3);
    }
  }
  return (undefined1 *)0x0;
}

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)