Alright so I encounter this issue a couple times and I don't actually know why. This especially occurs on weapons that have spread in them. It probably has something to do with the parent
function SWA280CImage::onFire(%this,%obj,%slot)
{
%projectile = SWA280CProjectile;
%spread = 0.0015;
%shellcount = 1;
%obj.playThread(2, plant);
%shellcount = 1;
//%obj.spawnExplosion(QuakeLittleRecoilProjectile,"1 1 1");
for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
scale = "1 1 1";
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
Parent::onFire(%this,%obj,%slot);
return %p;
}
If i remove the Parent::onFire at the bottom, the gun will fire properly with one bullet but all WeaponImage::onFire scripts will not work for it anymore. If I leave it, there will be two bullets coming out. Anyone know whats up?