L L4D2node

CompareSpawnOrder

0x006efd30 · 169 bytes · __cdecl

_ZL17CompareSpawnOrderP19HierarchicalSpawn_tS0_

Decompiled

undefined (2 params)

/* CompareSpawnOrder(HierarchicalSpawn_t*, HierarchicalSpawn_t*) */

int CompareSpawnOrder(HierarchicalSpawn_t *param_1,HierarchicalSpawn_t *param_2)

{
  char *pcVar1;
  char *pcVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if (*(int *)(param_1 + 4) == *(int *)(param_2 + 4)) {
    if (g_pClassnameSpawnPriority == (CStringRegistry *)0x0) {
      iVar5 = 0;
    }
    else {
      if (*(int *)param_1 == 0) {
        iVar3 = -1;
      }
      else {
        pcVar1 = *(char **)(*(int *)param_1 + 0x7c);
        pcVar2 = "";
        if (pcVar1 != (char *)0x0) {
          pcVar2 = pcVar1;
        }
        iVar3 = CStringRegistry::GetStringID(g_pClassnameSpawnPriority,pcVar2);
      }
      if (*(int *)param_2 == 0) {
        iVar4 = -1;
      }
      else {
        pcVar1 = *(char **)(*(int *)param_2 + 0x7c);
        pcVar2 = "";
        if (pcVar1 != (char *)0x0) {
          pcVar2 = pcVar1;
        }
        iVar4 = CStringRegistry::GetStringID(g_pClassnameSpawnPriority,pcVar2);
      }
      iVar5 = 1;
      if (iVar4 <= iVar3) {
        return -(uint)(iVar4 < iVar3);
      }
    }
  }
  else {
    iVar5 = (uint)(*(int *)(param_2 + 4) <= *(int *)(param_1 + 4)) * 2 + -1;
  }
  return iVar5;
}

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)