L L4D2node

CSceneEntity::GetSoundNameForPlayer

0x00811fc0 · 311 bytes · __thiscall

_ZN12CSceneEntity21GetSoundNameForPlayerEP12CChoreoEventP11CBasePlayerPcj

Decompiled

undefined (5 params)

/* CSceneEntity::GetSoundNameForPlayer(CChoreoEvent*, CBasePlayer*, char*, unsigned int) */

undefined4 __thiscall
CSceneEntity::GetSoundNameForPlayer
          (CSceneEntity *this,CChoreoEvent *param_1,CBasePlayer *param_2,char *param_3,uint param_4)

{
  bool bVar1;
  int iVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  char local_71;
  undefined4 local_70;
  char local_60 [64];
  int local_20;
  
  local_60[0] = '\0';
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = CChoreoEvent::GetCloseCaptionType(param_1);
  if ((iVar2 == 1) || (iVar2 = CChoreoEvent::GetCloseCaptionType(param_1), iVar2 == 2)) {
    local_71 = '\0';
    bVar1 = false;
  }
  else {
    local_71 = CChoreoEvent::GetPlaybackCloseCaptionToken(param_1,local_60,0x40);
    bVar1 = true;
  }
  pcVar3 = (char *)CChoreoEvent::GetParameters(param_1);
  V_strncpy(param_3,pcVar3,param_4);
  if (*(int *)(param_2 + 0x30) == 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(param_2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  pcVar3 = (char *)(**(code **)(*engine + 0xe0))(engine,iVar2,"english");
  if ((((pcVar3 == (char *)0x0) || (*pcVar3 == '\0')) || (iVar2 = V_atoi(pcVar3), iVar2 == 1)) &&
     (*(int *)(scene_forcecombined._28_4_ + 0x30) == 0)) {
    local_70 = 1;
  }
  else {
    local_70 = 0;
    if ((bVar1) && (local_70 = 1, local_71 != '\0')) {
      local_70 = 1;
      V_strncpy(param_3,local_60,param_4);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return local_70;
}

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)