Crash from Virtual Void?

Hey there! I was trying to implement a virtual void (a function that i can override in base classes), but I actually get a crash report when trying to call it:

Anybody know what this crash means?

Here is what I have in my base- and sub-classes →

Base class.h:

	/** [local] weapon specific fire implementation */
	virtual void FireWeapon() PURE_VIRTUAL(AInstinctWeapon::FireWeapon,);

Sub class.h:

virtual void FireWeapon() override;

hey, this is me just checking this out without really time to see in depth what’s going on with it, but maybe the problem is:

virtual void FireWeapon() PURE_VIRTUAL(AInstinctWeapon::FireWeapon***>>,<<***);

it looks to me as either you threw a random comma there, or you need a third argument.

Well I also noticed this, but I don’t know what that argument is supposed to be. The thing is that I got this script from the ShooterWeapon example and copied the Pure_Virtual part 1 to 1 from there…it would be odd if it would not work for me but for the shooter game example. Besides, a missing argument usually also results in a compile error. However, if you knew what I could put as an argument, I would give it a shot :wink:

hmm… then you may have missed a line or two from the other actors, and or this function has other dependancees.Bit hard to analyze, but “damaged” dependancees are usually a good place to start.

Yes, this is correct. The problem is that I was calling the function directly, which does not work. I made the following function instead:

void AWeapon::ManageFire()
{
	GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Black, TEXT("Managing weapon"));
	if (bReadyToShoot())
		{
			FireWeapon(); //call the  virtual here instead
			FireTimer = WeaponInfo.FireRate;
			if (WeaponInfo.UsesClip)
				{
				BulletsFired++;
				}
			else
				{
				Ammo--;
				}
		}
	if (bEmptyClip())
		{
		if (bCanReload())
			{
			ClipReload();
			}
		}
}