L L4D2node

SurvivorBot::TryGivePillsToPatient

0x00940da0 · 180 bytes · __thiscall

_ZN11SurvivorBot21TryGivePillsToPatientEP13CTerrorPlayerf

Decompiled

undefined (3 params)

/* SurvivorBot::TryGivePillsToPatient(CTerrorPlayer*, float) */

undefined4 __thiscall
SurvivorBot::TryGivePillsToPatient(SurvivorBot *this,CTerrorPlayer *param_1,float param_2)

{
  int iVar1;
  CTerrorPlayer *pCVar2;
  undefined4 uVar3;
  float local_14;
  undefined4 local_10;
  
  iVar1 = (**(code **)(*(int *)param_1 + 0x484))(param_1,4);
  if (iVar1 == 0) {
    local_14 = 3.4028235e+38;
    local_10 = 4;
    pCVar2 = CDirectorTacticalServices::
             GetSurvivorAbleToReachEntityFirst<SurvivorHasItemInSlotFilter>
                       (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_1,
                        (SurvivorHasItemInSlotFilter *)&local_10,&local_14);
    if ((((pCVar2 != (CTerrorPlayer *)0x0) &&
         (uVar3 = (**(code **)(*(int *)(this + 0x4028) + 0xe0))(this + 0x4028,pCVar2),
         (char)uVar3 != '\0')) && (local_14 < param_2)) &&
       (iVar1 = (**(code **)(*(int *)param_1 + 0x484))(param_1,5), iVar1 == 0)) {
      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)