PDA

View Full Version : Function Not Called, 'false' pseudoReturned


Extrarius
2nd Jun 2004, 08:14 PM
In the following, for some reason in the AlwaysFire function it acts as if CanFire always returns false and prints the appropriate log line, but [CanFire] is never displayed on the server or the client, as if it isn't actually calling the function (and obviously it isn't if its getting false back)

// My_BaseWeapon.uc
class My_BaseWeapon extends Weapon
abstract;

function bool CanFire()
{
Log("[CanFire]", 'MyMod');
return true;
}


// My_BaseFire.uc
class My_BaseFire extends WeaponFire;

simulated function bool AllowFire()
{
if(!Weapon.IsA('My_BaseWeapon'))
return Super.AllowFire();

if(!My_BaseWeapon(Weapon).CanFire())
{
Log("[AllowFire]: !My_BaseWeapon(Weapon).CanFire()",'MyMod');
return false;
}

return true;
}

Avram
2nd Jun 2004, 08:31 PM
Try adding simulated to CanFire.