L L4D2node

Script_ReapplyInfectedFlags

0x00b44f30 · 261 bytes · __cdecl

_ZL27Script_ReapplyInfectedFlagsiP9HSCRIPT__

Decompiled

undefined (2 params)

/* Script_ReapplyInfectedFlags(int, HSCRIPT__*) */

void Script_ReapplyInfectedFlags(int param_1,HSCRIPT__ *param_2)

{
  code *pcVar1;
  ScriptClassDesc_t *pSVar2;
  int *piVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  
  if (param_2 != (HSCRIPT__ *)0x0) {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar2 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
    piVar3 = (int *)(*pcVar1)(g_pScriptVM,param_2,pSVar2);
    if (piVar3 != (int *)0x0) {
      piVar3 = (int *)(**(code **)(*piVar3 + 0x148))(piVar3);
      if (piVar3 == (int *)0x0) {
        Warning();
        return;
      }
      piVar3 = (int *)(**(code **)(*piVar3 + 0xb4))(piVar3);
      iVar4 = (**(code **)(*piVar3 + 0x14c))(piVar3);
      if (iVar4 == 0) {
        return;
      }
      *(uint *)(iVar4 + 0x1c74) = *(uint *)(iVar4 + 0x1c74) & 0xffff1fff | param_1;
      return;
    }
  }
  iVar4 = TheNextBots();
  uVar5 = (uint)*(ushort *)(iVar4 + 0x10);
  if (uVar5 != 0xffff) {
    iVar6 = *(int *)(iVar4 + 4);
    do {
      piVar3 = *(int **)(iVar6 + uVar5 * 8);
      if (piVar3 == (int *)0x0) {
        Warning("Null bot passed to botcmd from script\n");
      }
      else {
        piVar3 = (int *)(**(code **)(*piVar3 + 0xb4))(piVar3);
        iVar6 = (**(code **)(*piVar3 + 0x14c))(piVar3);
        if (iVar6 != 0) {
          *(uint *)(iVar6 + 0x1c74) = *(uint *)(iVar6 + 0x1c74) & 0xffff1fff | param_1;
        }
      }
      iVar6 = *(int *)(iVar4 + 4);
      uVar5 = (uint)*(ushort *)(iVar6 + 6 + uVar5 * 8);
    } while (uVar5 != 0xffff);
  }
  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)