L L4D2node

PlayerReporter::CreateOrFindCurrentReport

0x008fe790 · 273 bytes · __thiscall

_ZN14PlayerReporter25CreateOrFindCurrentReportEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* PlayerReporter::CreateOrFindCurrentReport(CTerrorPlayer*) */

PlayerReport * __thiscall
PlayerReporter::CreateOrFindCurrentReport(PlayerReporter *this,CTerrorPlayer *param_1)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  PlayerReport *pPVar6;
  undefined4 uVar7;
  PlayerReport *local_20 [4];
  
  if ((param_1 != (CTerrorPlayer *)0x0) &&
     ((iVar3 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar3 != 3 ||
      (cVar2 = CTerrorGameRules::HasPlayerControlledZombies(), cVar2 != '\0')))) {
    iVar3 = CTerrorPlayer::GetPlayerReportID(param_1);
    if (*(ushort *)(this + 0x18) != 0xffff) {
      piVar1 = (int *)(*(int *)(this + 0xc) + (uint)*(ushort *)(this + 0x18) * 8);
      pPVar6 = (PlayerReport *)*piVar1;
      iVar4 = *(int *)(pPVar6 + 4);
      while( true ) {
        if (iVar3 == iVar4) {
          uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
          *(undefined4 *)pPVar6 = uVar7;
          return pPVar6;
        }
        if (*(ushort *)((int)piVar1 + 6) == 0xffff) break;
        piVar1 = (int *)(*(int *)(this + 0xc) + (uint)*(ushort *)((int)piVar1 + 6) * 8);
        pPVar6 = (PlayerReport *)*piVar1;
        iVar4 = *(int *)(pPVar6 + 4);
      }
    }
    iVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
    iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
    pPVar6 = ::operator_new(0x388);
                    /* try { // try from 008fe83f to 008fe843 has its CatchHandler @ 008fe8a7 */
    PlayerReport::PlayerReport(pPVar6,iVar4,iVar3,iVar5);
    local_20[0] = pPVar6;
    CUtlLinkedList<PlayerReport*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<PlayerReport*,unsigned_short>,unsigned_short>>
    ::InsertBefore((CUtlLinkedList<PlayerReport*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<PlayerReport*,unsigned_short>,unsigned_short>>
                    *)(this + 0xc),0xffff,local_20);
    return local_20[0];
  }
  return (PlayerReport *)0x0;
}

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)