Currently the Magazine Component is a generated class with no methods exposed to modders.
I propose the following.
class SCR_MagazineComponent: MagazineComponent
{
[Attribute("true", desc: "Should magazine be deleted when ammo count is 0?")]
protected bool m_DeleteEmpty;
//------------------------------------------------------------------------------------------------
override void SetAmmoCount(int ammoCount)
{
m_ammoCount = ammoCount;
Rpc(Rpc_Broadcast_SetAmmoCount,ammoCount);
}
//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void Rpc_Broadcast_SetAmmoCount(int ammoCount)
{
m_ammoCount = ammoCount;
}
//------------------------------------------------------------------------------------------------
array<int> GetAmmoMapping()
{
return m_AmmoMapping;
}
//------------------------------------------------------------------------------------------------
void SetAmmoMapping(array<int> ammoMapping)
{
m_AmmoMapping = ammoMapping;
Rpc(Rpc_Broadcast_SetAmmoMapping,ammoMapping);
}
//------------------------------------------------------------------------------------------------
[RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
protected void Rpc_Broadcast_SetAmmoMapping(array<int> ammoMapping)
{
m_AmmoMapping = ammoMapping;
}
//------------------------------------------------------------------------------------------------
}