L L4D2node

CStudioHdr::CActivityToSequenceMapping::ReleaseMapping

0x000e4140 · 633 bytes · __cdecl

_ZN10CStudioHdr26CActivityToSequenceMapping14ReleaseMappingEPS0_

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CStudioHdr::CActivityToSequenceMapping::ReleaseMapping(CStudioHdr::CActivityToSequenceMapping*)
    */

void CStudioHdr::CActivityToSequenceMapping::ReleaseMapping(CActivityToSequenceMapping *param_1)

{
  int *piVar1;
  int iVar2;
  uint uVar3;
  char cVar4;
  ushort uVar5;
  int iVar6;
  uint uVar7;
  int in_GS_OFFSET;
  bool bVar8;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  int local_64;
  undefined4 local_60 [20];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if ((param_1 == (CActivityToSequenceMapping *)0x0) ||
     (param_1 == (CActivityToSequenceMapping *)emptyMapping)) goto LAB_000e4300;
  local_74 = 0;
  local_70 = 0;
  if (_exit == 0) {
    local_64 = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_74,0,0,0,0,"/data/src/engine/../public/studio.cpp",0x895,
               &ReleaseMapping(CStudioHdr::CActivityToSequenceMapping*)::tm_fmt,"(%s)%s",
               "Unaccounted","CStudioHdr::CActivityToSequenceMapping::ReleaseMapping");
    local_64 = _exit;
  }
  iVar2 = _DAT_0040b9d4;
  local_6c = local_74;
  local_68 = local_70;
                    /* try { // try from 000e4213 to 000e4217 has its CatchHandler @ 000e43d3 */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar6 = ThreadGetCurrentId(), iVar2 == iVar6)) {
    if ((char *)*_DAT_0040b030 != "CStudioHdr::CActivityToSequenceMapping::ReleaseMapping") {
                    /* try { // try from 000e43b0 to 000e43c1 has its CatchHandler @ 000e43d3 */
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a4cb4,&DAT_00000001,0x2a054b);
    }
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
                    /* try { // try from 000e4220 to 000e4255 has its CatchHandler @ 000e43e8 */
  uVar7 = ThreadGetCurrentId();
  if (uVar7 == g_StudioHdrToActivityMapsLock) {
LAB_000e4260:
    DAT_0034e6a4 = DAT_0034e6a4 + 1;
  }
  else {
    LOCK();
    bVar8 = g_StudioHdrToActivityMapsLock == 0;
    uVar3 = uVar7;
    if (!bVar8) {
      uVar3 = g_StudioHdrToActivityMapsLock;
    }
    g_StudioHdrToActivityMapsLock = uVar3;
    UNLOCK();
    if (bVar8) goto LAB_000e4260;
    CThreadFastMutex::Lock(0x34e6a0,uVar7);
  }
  local_60[0] = *(undefined4 *)(param_1 + 0x24);
                    /* try { // try from 000e4281 to 000e4285 has its CatchHandler @ 000e43f8 */
  uVar5 = CUtlRBTree<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Find((CUtlRBTree<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  *)g_StudioHdrToActivityMaps,(Node_t *)local_60);
  if (uVar5 != 0xffff) {
    piVar1 = (int *)((uint)uVar5 * 0x58 + g_StudioHdrToActivityMaps._4_4_ + 0x50);
    *piVar1 = *piVar1 + -1;
  }
  iVar2 = _DAT_0040b9d4;
  DAT_0034e6a4 = DAT_0034e6a4 + -1;
  if (DAT_0034e6a4 == 0) {
    LOCK();
    UNLOCK();
    g_StudioHdrToActivityMapsLock = 0;
  }
  if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
     (iVar6 = ThreadGetCurrentId(), iVar2 == iVar6)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
    }
    DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
  }
  if (local_64 != 0) {
    (**(code **)(local_64 + 0x54))(local_64,local_6c,local_68,0,0,0);
  }
LAB_000e4300:
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)