Function Not Called, 'false' pseudoReturned

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Extrarius

New Member
Mar 19, 2004
14
0
0
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)

Code:
// 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;
}
 
Last edited: