L L4D2node

CBaseEntity::ConnectOutputToScript

0x00605150 · 333 bytes · __thiscall

_ZN11CBaseEntity21ConnectOutputToScriptEPKcS1_

Decompiled

undefined (3 params)

/* CBaseEntity::ConnectOutputToScript(char const*, char const*) */

void __thiscall CBaseEntity::ConnectOutputToScript(CBaseEntity *this,char *param_1,char *param_2)

{
  int iVar1;
  CBaseEntityOutput *this_00;
  int iVar2;
  char *pcVar3;
  CEventAction *this_01;
  int *piVar4;
  char *pcVar5;
  int local_20 [4];
  
  this_00 = (CBaseEntityOutput *)FindNamedOutput(this,param_1);
  if (this_00 == (CBaseEntityOutput *)0x0) {
    DevMsg();
    return;
  }
  pcVar5 = "!self";
  AllocPooledString((char *)local_20);
  iVar1 = local_20[0];
  piVar4 = *(int **)(this_00 + 0x14);
  if (piVar4 != (int *)0x0) {
    do {
      if (((iVar1 == *piVar4) && ((float)piVar4[3] == 0.0)) && (piVar4[4] == -1)) {
        pcVar5 = "CallScriptFunction";
        pcVar3 = (char *)piVar4[1];
        if ((char *)piVar4[1] == (char *)0x0) {
          pcVar3 = "";
        }
        iVar2 = _V_strcmp(pcVar3,"CallScriptFunction");
        if (iVar2 == 0) {
          pcVar3 = (char *)piVar4[2];
          if ((char *)piVar4[2] == (char *)0x0) {
            pcVar3 = "";
          }
          pcVar5 = param_2;
          iVar2 = _V_strcmp(pcVar3,param_2);
          if (iVar2 == 0) {
            return;
          }
        }
      }
      piVar4 = (int *)piVar4[6];
    } while (piVar4 != (int *)0x0);
  }
  this_01 = CEventAction::operator_new((CEventAction *)0x1c,(uint)pcVar5);
                    /* try { // try from 00605239 to 0060523d has its CatchHandler @ 006052ad */
  CEventAction::CEventAction(this_01,(char *)0x0);
  *(int *)this_01 = iVar1;
  AllocPooledString((char *)local_20);
  *(int *)(this_01 + 4) = local_20[0];
  AllocPooledString((char *)local_20);
  *(int *)(this_01 + 8) = local_20[0];
  CBaseEntityOutput::AddEventAction(this_00,this_01);
  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)