forked from hereswhisper/Eon-Gameserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeapon.h
28 lines (23 loc) · 740 Bytes
/
Weapon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include "ue.h"
#include "Inventory.h"
__int64 (*OnReloadOG)(AFortWeapon* Weapon, int RemoveCount);
__int64 OnReload(AFortWeapon* Weapon, int RemoveCount)
{
auto Ret = OnReloadOG(Weapon, RemoveCount);
auto WeaponDef = Weapon->WeaponData;
if (!WeaponDef)
return Ret;
auto AmmoDef = WeaponDef->GetAmmoWorldItemDefinition_BP();
if (!AmmoDef)
return Ret;
AFortPlayerPawnAthena* Pawn = (AFortPlayerPawnAthena*)Weapon->GetOwner();
AFortPlayerControllerAthena* PC = (AFortPlayerControllerAthena*)Pawn->Controller;
if (!PC->IsA(AFortPlayerControllerAthena::StaticClass()))
return Ret;
if (PC->bInfiniteAmmo)
return Ret;
Remove(PC, AmmoDef, RemoveCount);
UpdateLoadedAmmo(PC, Weapon, RemoveCount);
return Ret;
}