L L4D2node

CDirectorChallengeMode::ScriptAllowBash

0x0089e240 · 417 bytes · __thiscall

_ZN22CDirectorChallengeMode15ScriptAllowBashEP11CBaseEntityS1_

Decompiled

undefined (3 params)

/* CDirectorChallengeMode::ScriptAllowBash(CBaseEntity*, CBaseEntity*) */

void * __thiscall
CDirectorChallengeMode::ScriptAllowBash
          (CDirectorChallengeMode *this,CBaseEntity *param_1,CBaseEntity *param_2)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  int iVar3;
  void *pvVar4;
  void *local_50;
  void *local_40 [2];
  short local_38;
  ushort local_36;
  void *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  if (*(int *)(this + 0x124) - 1U < 0xfffffffe) {
    local_38 = 0;
    local_36 = 0;
    local_40[0] = (void *)0x0;
    if (param_2 == (CBaseEntity *)0x0) {
      local_50 = (void *)0x0;
    }
    else {
                    /* try { // try from 0089e285 to 0089e2bf has its CatchHandler @ 0089e414 */
      local_50 = (void *)CBaseEntity::GetScriptInstance(param_2);
    }
    if (param_1 == (CBaseEntity *)0x0) {
      local_34 = (void *)0x0;
    }
    else {
      local_34 = (void *)CBaseEntity::GetScriptInstance(param_1);
    }
    uVar1 = *(undefined4 *)(this + 0x124);
    puVar2 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
    local_2c = 0x20;
    local_2a = 0;
    local_20 = 0x20;
    local_1e = 0;
    local_28 = local_50;
    local_30 = 0;
    local_24 = 0;
                    /* try { // try from 0089e328 to 0089e32a has its CatchHandler @ 0089e3ef */
    iVar3 = (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,uVar1,&local_34,2,local_40,*puVar2,1);
    if ((local_1e & 1) != 0) {
      free(local_28);
      local_1e = local_1e & 0xfffe;
    }
    local_28 = (void *)0x0;
    local_24 = 0;
    local_20 = 0;
    if ((local_2a & 1) != 0) {
      free(local_34);
    }
    if (iVar3 == 0) {
      pvVar4 = (void *)(int)(float)local_40[0];
      if (local_38 == 5) {
        pvVar4 = local_40[0];
      }
      if ((local_36 & 1) == 0) {
        return pvVar4;
      }
      free(local_40[0]);
      return pvVar4;
    }
                    /* try { // try from 0089e397 to 0089e39b has its CatchHandler @ 0089e414 */
    DevWarning("Failed to call AllowBash though we think we have one\n");
    if ((local_36 & 1) != 0) {
      free(local_40[0]);
    }
  }
  return (void *)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)