A_M_Refire bug

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Enjay
 
 
Posts: 27280
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

A_M_Refire bug

Post by Enjay »

Git Builds of Z and GZDoom as of 29th Dec affected.

I thought I may as well log this as a bug just so it doesn't get forgotten. I don't know if the intention is to address this or just to leave is "as is" but, just in case:

http://forum.zdoom.org/viewtopic.php?f=3&t=54550

As I understand it, A_M_Refire now requires a state label as one of its parameters whereas previously it didn't. If no state label is provided, the game cannot start. Although it's a little used function, it would appear that there are some mods "in the wild" that use it and, consequently, these will be broken by the current way of handling things.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_M_Refire bug

Post by Graf Zahl »

The state is optional. What happens?

Code: Select all

	//============================================================================
	//
	// A_M_Refire
	//
	//============================================================================

	void A_M_Refire (bool ignoremissile, statelabel jumpto = null)
	{
		if (target == null || target.health <= 0)
		{
			if (MissileState && random[SMarineRefire]() < 160)
			{ // Look for a new target most of the time
				if (LookForPlayers (true) && CheckMissileRange ())
				{ // Found somebody new and in range, so don't stop shooting
					return;
				}
			}
			if (jumpto != null) SetStateLabel (jumpto);
			else SetState(CurState + 1);
			return;
		}
		if (((ignoremissile || MissileState == null) && !CheckMeleeRange ()) ||
			!CheckSight (target) ||	random[SMarineRefire]() < 4)	// Small chance of stopping even when target not dead
		{
			if (jumpto != null) SetStateLabel (jumpto);
			else SetState(CurState + 1);
		}
	}

User avatar
Enjay
 
 
Posts: 27280
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_M_Refire bug

Post by Enjay »

Image
(It's a GZDoom mod and the red errors don't appear in GZDoom)

Code: Select all

	Missile.Pistol:
		PLAY E 4 A_FaceTarget
		PLAY F 0 BRIGHT A_CustomMissile ("EDMageWandMissile", 36, 0, 0)
		PLAY F 6 BRIGHT A_PlaySound ("MageWandFire")
		PLAY A 4 A_FaceTarget
		PLAY A 0 A_M_Refire
		PLAY A 5
		Goto See
The actor in question is just a modified scripted marine (using "replaces" in DECORATE and mostly copied and pasted from the Scripted marines in zdoom.pk3). If the above instance of A_M_Refire is replaced or fixed, then the next instance of it without parameters causes ZDoom to choke.

Some times A_M_Refire is used like A_M_Refire(1) (i.e. it sets the bool to ignoremissile) and ZDoom does not choke on those but whenever A_M_Refire is used without parameters, the above error occurs.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_M_Refire bug

Post by Graf Zahl »

Yes, but that wasn't due to the state but that ignoremissile lost its default.
User avatar
Enjay
 
 
Posts: 27280
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_M_Refire bug

Post by Enjay »

I'm sorry, I'm not understanding the problem. :(

[edit] Are you merely clarifying that my original description of the problem was incorrect: i.e. I was attributing it to the missing state label rather than the ignoremissile default being lost? [/edit]

The above code is basically the same as the original DECORATE Scripted Marine code [wiki]Classes:ScriptedMarine[/wiki] and simply copying and pasting that code from the Wiki with no alterations (other than to convert it to a "replaces" actor) flags up the same error. (See attached.)

Image
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_M_Refire bug

Post by Rachael »

I think Graf may have fixed the bug but it didn't make it into the official GZDoom release. QZDoom, however, managed to snatch this before the release was finalized. It would not be out of line to assume that Graf may release another GZDoom in a few days to include this fix.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_M_Refire bug

Post by Graf Zahl »

Definitely. There has been a second fix, btw. - but I'll wait first to see if more comes up.
User avatar
Enjay
 
 
Posts: 27280
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_M_Refire bug

Post by Enjay »

Oooh, I hadn't noticed the new official GZDoom, thanks.

But yes, just to confirm, the new official GZDoom, the Jan 1st build and the 29th Dec build of ZDoom do indeed choke on the above posted DECORATE whereas today's QZDoom does not.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: A_M_Refire bug

Post by Ed the Bat »

If this is being fixed engine-side, perhaps I should make a report about the other issue I mention in the thread Enjay linked in OP. I was happy to hotfix Lizard Squad if both of these issues stopped it from running in the latest dev builds, but if it's just the one issue now...
Post Reply

Return to “Closed Bugs [GZDoom]”