L L4D2node

CBaseServerVehicle::NPC_AddPassenger

0x00b3b600 · 181 bytes · __thiscall

_ZN18CBaseServerVehicle16NPC_AddPassengerEP20CBaseCombatCharacter8string_ti

Decompiled

undefined (4 params)

/* CBaseServerVehicle::NPC_AddPassenger(CBaseCombatCharacter*, string_t, int) */

undefined4 __thiscall
CBaseServerVehicle::NPC_AddPassenger
          (CBaseServerVehicle *this,int *param_1,undefined4 param_3,int param_4)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  int iVar5;
  
  if ((param_1 == (int *)0x0) ||
     (uVar1 = (**(code **)(*param_1 + 0x16c))(param_1), (char)uVar1 != '\0')) {
    return 0;
  }
  iVar2 = FindRoleIndexByName(this,param_3);
  if (iVar2 == -1) {
    return uVar1;
  }
  piVar3 = (int *)(**(code **)(*(int *)this + 0x8c))(this,iVar2,param_4);
  if (param_1 != piVar3) {
    if (piVar3 != (int *)0x0) {
      return uVar1;
    }
    if (*(int *)(this + 0x10) < 1) {
      return uVar1;
    }
    piVar3 = *(int **)(this + 4);
    iVar5 = 0;
    while ((param_4 != piVar3[1] || (iVar2 != *piVar3))) {
      iVar5 = iVar5 + 1;
      piVar3 = piVar3 + 5;
      if (iVar5 == *(int *)(this + 0x10)) {
        return uVar1;
      }
    }
    piVar4 = (int *)(**(code **)(*param_1 + 0xc))(param_1);
    piVar3[4] = *piVar4;
    return 1;
  }
  return 1;
}

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)