L L4D2node

CBaseEntity::AcceptInput

0x006101c0 · 2466 bytes · __thiscall

_ZN11CBaseEntity11AcceptInputEPKcPS_S2_9variant_ti

Decompiled

undefined (6 params)

/* CBaseEntity::AcceptInput(char const*, CBaseEntity*, CBaseEntity*, variant_t, int) */

undefined1 __thiscall
CBaseEntity::AcceptInput
          (CBaseEntity *this,char *param_1,CBaseEntity *param_2,CBaseEntity *param_3,
          variant_t *param_5,undefined4 param_6)

{
  CBaseEdict *this_00;
  undefined1 uVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined4 uVar6;
  int *piVar7;
  code *pcVar8;
  undefined1 *puVar9;
  int iVar10;
  char *pcVar11;
  char *pcVar12;
  int iVar13;
  int in_GS_OFFSET;
  Vector *local_278;
  void *local_258 [2];
  undefined2 local_250;
  ushort local_24e;
  void *local_24c;
  undefined4 local_248;
  uint local_244;
  CBaseEntity *local_240;
  CBaseEntity *local_23c;
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  undefined4 local_22c;
  undefined4 local_228;
  undefined4 local_224;
  char local_21f [255];
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (this[8] == (CBaseEntity)0x0) {
    if (*(int *)(ent_messages_draw._28_4_ + 0x30) != 0) {
      if (param_3 != (CBaseEntity *)0x0) {
        if (((byte)this[0x14d] & 8) != 0) {
          CalcAbsolutePosition(this);
        }
        if (((byte)param_3[0x14d] & 8) != 0) {
          CalcAbsolutePosition(param_3);
        }
        NDebugOverlay::Line((Vector *)(param_3 + 0x2e0),(Vector *)(this + 0x2e0),0xff,0xff,0xff,
                            false,3.0);
        local_240 = (CBaseEntity *)0x40800000;
        local_23c = (CBaseEntity *)0x40800000;
        local_238 = 0x40800000;
        local_24c = (void *)0xc0800000;
        local_248 = 0xc0800000;
        local_244 = 0xc0800000;
        if (((byte)param_3[0x14d] & 8) != 0) {
          CalcAbsolutePosition(param_3);
        }
        NDebugOverlay::Box((Vector *)(param_3 + 0x2e0),(Vector *)&local_24c,(Vector *)&local_240,
                           0xff,0,0,0,3.0);
      }
      local_278 = (Vector *)&local_240;
      if (((byte)this[0x14d] & 8) != 0) {
        CalcAbsolutePosition(this);
      }
      NDebugOverlay::Text((Vector *)(this + 0x2e0),param_1,false,3.0);
      local_240 = (CBaseEntity *)0x40800000;
      local_23c = (CBaseEntity *)0x40800000;
      local_238 = 0x40800000;
      local_24c = (void *)0xc0800000;
      local_248 = 0xc0800000;
      local_244 = 0xc0800000;
      if (((byte)this[0x14d] & 8) != 0) {
        CalcAbsolutePosition(this);
      }
      NDebugOverlay::Box((Vector *)(this + 0x2e0),(Vector *)&local_24c,local_278,0,0xff,0,0,3.0);
    }
    for (piVar3 = (int *)(**(code **)(*(int *)this + 0x30))(this); piVar3 != (int *)0x0;
        piVar3 = (int *)piVar3[3]) {
      if (0 < piVar3[1]) {
        iVar13 = 0;
        do {
          iVar10 = iVar13 * 0x40;
          if (((*(byte *)(*piVar3 + iVar10 + 0xe) & 8) != 0) &&
             (iVar4 = _V_stricmp(*(char **)(*piVar3 + iVar10 + 0x10),param_1), iVar4 == 0)) {
            if (param_3 == (CBaseEntity *)0x0) {
              if (*(int *)(param_5 + 0x10) == 2) {
                puVar5 = &DAT_00d539c2;
                if (*(undefined1 **)param_5 != (undefined1 *)0x0) {
                  puVar5 = *(undefined1 **)param_5;
                }
              }
              else {
                puVar5 = (undefined1 *)variant_t::ToString(param_5);
              }
              uVar6 = GetDebugName(this);
              V_snprintf(local_120,0x100,"(%0.2f) input <NULL>: %s.%s(%s)\n",
                         (double)*(float *)(gpGlobals + 0xc),uVar6,param_1,puVar5);
            }
            else {
              if (*(int *)(param_5 + 0x10) == 2) {
                puVar5 = &DAT_00d539c2;
                if (*(undefined1 **)param_5 != (undefined1 *)0x0) {
                  puVar5 = *(undefined1 **)param_5;
                }
              }
              else {
                puVar5 = (undefined1 *)variant_t::ToString(param_5);
              }
              uVar6 = GetDebugName(this);
              puVar9 = &DAT_00d539c2;
              if (*(undefined1 **)(param_3 + 0x154) != (undefined1 *)0x0) {
                puVar9 = *(undefined1 **)(param_3 + 0x154);
              }
              V_snprintf(local_120,0x100,"(%0.2f) input %s: %s.%s(%s)\n",
                         (double)*(float *)(gpGlobals + 0xc),puVar9,uVar6,param_1,puVar5);
            }
            DevMsg(2,"%s",local_120);
            if (((byte)this[0x110] & 0x10) != 0) {
              local_240 = *(CBaseEntity **)param_5;
              local_23c = *(CBaseEntity **)(param_5 + 4);
              local_238 = *(undefined4 *)(param_5 + 8);
              local_234 = *(undefined4 *)(param_5 + 0xc);
              local_230 = *(undefined4 *)(param_5 + 0x10);
              DrawInputOverlay(this,param_1,param_3,&local_240);
            }
            piVar7 = (int *)(*piVar3 + iVar10);
            iVar13 = *piVar7;
            if ((*(int *)(param_5 + 0x10) != iVar13) &&
               ((*(int *)(param_5 + 0x10) != 0 || (iVar13 != 2)))) {
              cVar2 = variant_t::Convert(param_5,iVar13);
              if (cVar2 == '\0') {
                if (param_3 == (CBaseEntity *)0x0) {
                  pcVar12 = "<null>";
                  pcVar11 = "<null>";
                }
                else {
                  pcVar12 = *(char **)(param_3 + 0x154);
                  pcVar11 = *(char **)(param_3 + 0x7c);
                  if (pcVar12 == (char *)0x0) {
                    pcVar12 = "";
                  }
                  if (pcVar11 == (char *)0x0) {
                    pcVar11 = "";
                  }
                }
                uVar6 = GetDebugName(this);
                puVar5 = &DAT_00d539c2;
                if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
                  puVar5 = *(undefined1 **)(this + 0x7c);
                }
                Warning("!! ERROR: bad input/output link:\n!! %s(%s,%s) doesn\'t match type from %s(%s)\n"
                        ,puVar5,uVar6,param_1,pcVar11,pcVar12);
                uVar1 = 0;
                goto LAB_0061024f;
              }
              piVar7 = (int *)(*piVar3 + iVar10);
            }
            pcVar8 = (code *)piVar7[6];
            iVar13 = piVar7[7];
            if (pcVar8 == (code *)0x0) {
              uVar1 = 1;
              if ((*(byte *)((int)piVar7 + 0xe) & 4) == 0) goto LAB_0061024f;
              variant_t::SetOther(param_5,this + piVar7[2]);
              if (this[0x6c] == (CBaseEntity)0x0) {
                this_00 = *(CBaseEdict **)(this + 0x30);
                if (this_00 != (CBaseEdict *)0x0) {
                  *(uint *)this_00 = *(uint *)this_00 | 0x101;
                  iVar13 = CBaseEdict::GetChangeAccessor(this_00);
                  *(undefined2 *)(iVar13 + 2) = 0;
                }
              }
              else {
                this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
              }
              *(undefined4 *)(this + 0x74) = *(undefined4 *)(gpGlobals + 0xc);
              *(undefined4 *)(this + 0x78) = 0;
            }
            else {
              local_250 = 0;
              local_24e = 0;
              local_258[0] = (void *)0x0;
              local_23c = param_3;
              local_238 = *(undefined4 *)param_5;
              local_240 = param_2;
              local_234 = *(undefined4 *)(param_5 + 4);
              local_230 = *(undefined4 *)(param_5 + 8);
              local_22c = *(undefined4 *)(param_5 + 0xc);
              local_228 = *(undefined4 *)(param_5 + 0x10);
              local_224 = param_6;
              if (*(int *)(this + 1000) == -1) {
LAB_00610932:
                if (((uint)pcVar8 & 1) != 0) {
                  pcVar8 = *(code **)(pcVar8 + *(int *)(this + iVar13) + -1);
                }
                (*pcVar8)(this + iVar13,&local_240);
              }
              else {
                    /* try { // try from 00610786 to 006107bc has its CatchHandler @ 00610b6e */
                _V_strcpy(local_21f,"Input");
                V_strncat(local_21f,param_1,0xff,-1);
                if (param_2 == (CBaseEntity *)0x0) {
                  local_24c = (void *)0x0;
                  local_244 = 0;
                }
                else {
                  local_24c = (void *)GetScriptInstance(param_2);
                  local_244 = 0x20;
                }
                    /* try { // try from 006107fc to 006107fe has its CatchHandler @ 00610b99 */
                (**(code **)(*g_pScriptVM + 0x78))(g_pScriptVM,0,"activator",&local_24c);
                if ((local_244 & 0x10000) != 0) {
                  free(local_24c);
                }
                if (param_3 == (CBaseEntity *)0x0) {
                  local_24c = (void *)0x0;
                  local_244 = 0;
                }
                else {
                    /* try { // try from 0061082d to 00610831 has its CatchHandler @ 00610b6e */
                  local_24c = (void *)GetScriptInstance(param_3);
                  local_244 = 0x20;
                }
                    /* try { // try from 0061086b to 0061086d has its CatchHandler @ 00610b85 */
                (**(code **)(*g_pScriptVM + 0x78))(g_pScriptVM,0,"caller",&local_24c);
                if ((local_244 & 0x10000) != 0) {
                  free(local_24c);
                }
                    /* try { // try from 006108a4 to 00610965 has its CatchHandler @ 00610b6e */
                cVar2 = CallScriptFunction(this,local_21f,(CVariantBase *)local_258,false);
                if ((cVar2 == '\0') || (local_258[0]._0_1_ != (CVariantBase)0x0)) goto LAB_00610932;
              }
              if (*(int *)(this + 1000) != -1) {
                (**(code **)(*g_pScriptVM + 0xa0))(g_pScriptVM,0,"activator");
                (**(code **)(*g_pScriptVM + 0xa0))(g_pScriptVM,0,"caller");
              }
              if ((local_24e & 1) != 0) {
                free(local_258[0]);
              }
            }
            uVar1 = 1;
            goto LAB_0061024f;
          }
          iVar13 = iVar13 + 1;
        } while (iVar13 < piVar3[1]);
      }
    }
    uVar6 = GetDebugName(this);
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevMsg(2,"unhandled input: (%s) -> (%s,%s)\n",param_1,puVar5,uVar6);
    uVar1 = 0;
  }
  else {
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevMsg(2,"Input %s for %s entity dropped because the entity is in stasis.\n",param_1,puVar5);
    uVar1 = 0;
  }
LAB_0061024f:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)