Skip to content

Commit 5fc19c8

Browse files
committed
Adjust logic to call 'em
1 parent 7857dee commit 5fc19c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6119,6 +6119,21 @@ bool CClientPed::ReloadWeapon() noexcept
61196119
if (!CanReloadWeapon() || (task && task->GetTaskType() == TASK_SIMPLE_USE_GUN))
61206120
return false;
61216121

6122+
CLuaArguments args;
6123+
args.PushNumber(weapon->GetType());
6124+
args.PushNumber(weapon->GetAmmoInClip());
6125+
args.PushNumber(weapon->GetAmmoTotal());
6126+
6127+
bool result = false;
6128+
6129+
if (IS_PLAYER(this))
6130+
result = CallEvent("onClientPlayerWeaponReload", args, true);
6131+
else
6132+
result = CallEvent("onClientPedWeaponReload", args, true);
6133+
6134+
if (!result)
6135+
return false;
6136+
61226137
weapon->SetState(WEAPONSTATE_RELOADING);
61236138
return true;
61246139
}

0 commit comments

Comments
 (0)