L L4D2node

CTerrorPlayer::UpdateSpeechFriendlyFire

0x009fb6a0 · 295 bytes · __thiscall

_ZN13CTerrorPlayer24UpdateSpeechFriendlyFireEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateSpeechFriendlyFire() */

void __thiscall CTerrorPlayer::UpdateSpeechFriendlyFire(CTerrorPlayer *this)

{
  uint uVar1;
  code *pcVar2;
  undefined4 uVar3;
  char *pcVar4;
  longdouble lVar5;
  CAI_Concept local_24 [20];
  
  if (0.0 < *(float *)(this + 0x3340)) {
    lVar5 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x3340) <= (float)lVar5) {
      if (*(float *)(this + 0x3340) != -1.0) {
        (**(code **)(*(int *)(this + 0x3338) + 4))(this + 0x3338,this + 0x3340);
        *(undefined4 *)(this + 0x3340) = 0xbf800000;
      }
      uVar1 = *(uint *)(this + 0x3350);
      pcVar4 = "DMG_BULLET";
      if ((((uVar1 & 2) == 0) && (pcVar4 = "DMG_BLAST", (uVar1 & 0x40) == 0)) &&
         (pcVar4 = "DMG_BURN", (uVar1 & 8) == 0)) {
        pcVar4 = "DMG_GENERIC";
      }
      uVar3 = SurvivorCharacterName(*(undefined4 *)(this + 0x3334));
      uVar3 = UTIL_VarArgs("Subject:%s,DamageType:%s,Weapon:%s",uVar3,pcVar4,this + 0x3354);
      pcVar2 = *(code **)(*(int *)this + 0x7b4);
      CAI_Concept::CAI_Concept(local_24,"PlayerFriendlyFire");
      (*pcVar2)(this,local_24,1,uVar3,0,0,0);
    }
  }
  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)