L L4D2node

CDirectorChallengeMode::ScriptInterceptChat

0x0089ef80 · 370 bytes · __thiscall

_ZN22CDirectorChallengeMode19ScriptInterceptChatEP11CBaseEntityPKc

Decompiled

undefined (3 params)

/* CDirectorChallengeMode::ScriptInterceptChat(CBaseEntity*, char const*) */

uint __thiscall
CDirectorChallengeMode::ScriptInterceptChat
          (CDirectorChallengeMode *this,CBaseEntity *param_1,char *param_2)

{
  undefined4 *puVar1;
  int iVar2;
  uint uVar3;
  void *local_40 [2];
  short local_38;
  ushort local_36;
  char *local_34;
  undefined4 local_30;
  undefined2 local_2c;
  ushort local_2a;
  void *local_28;
  undefined4 local_24;
  undefined2 local_20;
  ushort local_1e;
  
  iVar2 = *(int *)(this + 0x130);
  if (iVar2 - 1U < 0xfffffffe) {
    local_38 = 0;
    local_36 = 0;
    local_40[0] = (void *)0x0;
    if (param_1 == (CBaseEntity *)0x0) {
      local_28 = (void *)0x0;
    }
    else {
                    /* try { // try from 0089efc2 to 0089efe6 has its CatchHandler @ 0089f130 */
      local_28 = (void *)CBaseEntity::GetScriptInstance(param_1);
      iVar2 = *(int *)(this + 0x130);
    }
    puVar1 = (undefined4 *)CDirector::GetScriptScope(TheDirector,3);
    local_2a = 0;
    local_2c = 0x1f;
    local_1e = 0;
    local_30 = 0;
    local_24 = 0;
    local_34 = param_2;
    local_20 = 0x20;
                    /* try { // try from 0089f04c to 0089f04e has its CatchHandler @ 0089f109 */
    iVar2 = (**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar2,&local_34,2,local_40,*puVar1,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 (iVar2 != 0) {
                    /* try { // try from 0089f0cf to 0089f0d3 has its CatchHandler @ 0089f130 */
      DevWarning("Tried calling InterceptChat but failed\n");
    }
    if (local_38 == 6) {
      uVar3 = (uint)local_40[0] & 0xff;
      if ((local_36 & 1) == 0) {
        return uVar3;
      }
      free(local_40[0]);
      return uVar3;
    }
    if ((local_36 & 1) != 0) {
      free(local_40[0]);
    }
  }
  return 1;
}

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)