L L4D2node

CHolidayGift::MyTouch

0x008d1360 · 226 bytes · __thiscall

_ZN12CHolidayGift7MyTouchEP11CBasePlayer

Decompiled

undefined (2 params)

/* CHolidayGift::MyTouch(CBasePlayer*) */

undefined4 __thiscall CHolidayGift::MyTouch(CHolidayGift *this,CBasePlayer *param_1)

{
  code *pcVar1;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  
  if ((((param_1 != (CBasePlayer *)0x0) &&
       (uVar3 = (**(code **)(*(int *)param_1 + 300))(param_1), (char)uVar3 != '\0')) &&
      (cVar2 = (**(code **)(*(int *)param_1 + 0x778))(param_1), cVar2 == '\0')) &&
     (iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), iVar4 == 2)) {
    piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"christmas_gift_grab",0,0);
    if (piVar5 != (int *)0x0) {
      pcVar1 = *(code **)(*piVar5 + 0x30);
      uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
      (*pcVar1)(piVar5,"userid",uVar6);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
    }
    CBaseEntity::EmitSound((CBaseEntity *)param_1,"Christmas.GiftPickup",0.0,(float *)0x0);
    return uVar3;
  }
  return 0;
}

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)