Basically, I've been struggling for the past week or so to set up iron sights within Rykuta's weapon system. The issue has been getting ammo to properly transfer between the base and ADS images.
With help from Rykuta, I've gotten this far:
function R101CADSImage::onMount(%this,%obj,%slot)
{
%newAmmo = %obj.clipAmmo[%obj.tool[%slot].Image];
Parent::onMount(%this,%obj,%slot);
%obj.pushDatablock(SlowArmor.getID());
%obj.clipAmmo[%obj.tool[%slot].Image] = %newAmmo;
}
function R101CADSImage::onUnMount(%this,%obj,%slot)
{
%newAmmo = %obj.clipAmmo[%obj.tool[%slot].Image];
Parent::onUnMount(%this,%obj,%slot);
%obj.popDatablock(SlowArmor.getID());
%obj.clipAmmo[%obj.tool[%slot].Image] = %newAmmo;
}
What I need to do is define %slot as being the equipped item, but Rykuta didn't remember exactly how this is done. Any help?