L L4D2node

CMultiSource::Use

0x006e7eb0 · 290 bytes · __cdecl

_ZN12CMultiSource3UseEP11CBaseEntityS1_8USE_TYPEf

Decompiled

undefined (4 params)

/* CMultiSource::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */

void CMultiSource::Use(CBaseEntity *param_1,CBaseEntity *param_2,int param_3)

{
  uint uVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  undefined4 uVar5;
  undefined *puVar6;
  
  iVar4 = 0;
  do {
    while( true ) {
      if (*(int *)(param_1 + 0x558) <= iVar4) goto LAB_006e7f20;
      iVar4 = iVar4 + 1;
      uVar1 = *(uint *)(param_1 + iVar4 * 4 + 0x43c);
      if (((uVar1 == 0xffffffff) ||
          (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) break;
      if (param_3 == *(int *)(puVar6 + 4)) goto LAB_006e7f20;
    }
  } while (param_3 != 0);
LAB_006e7f20:
  if (*(int *)(param_1 + 0x558) < iVar4) {
    Warning();
    return;
  }
  *(uint *)(param_1 + iVar4 * 4 + 0x4bc) = *(uint *)(param_1 + iVar4 * 4 + 0x4bc) ^ 1;
  cVar3 = (**(code **)(*(int *)param_1 + 0x13c))(param_1,param_2);
  if (cVar3 != '\0') {
    uVar2 = *(undefined4 *)(param_1 + 0x558);
    uVar5 = CBaseEntity::GetDebugName(param_1);
    DevMsg(2,"Multisource %s enabled (%d inputs)\n",uVar5,uVar2);
    COutputEvent::FireOutput((COutputEvent *)(param_1 + 0x540),param_2,param_1,0.0);
    return;
  }
  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)