A_M_Refire bug
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.
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.
A_M_Refire bug
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_M_Refire bug
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);
}
}
Re: A_M_Refire bug

(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
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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_M_Refire bug
Yes, but that wasn't due to the state but that ignoremissile lost its default.
Re: A_M_Refire bug
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.)

[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.)

Re: A_M_Refire bug
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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_M_Refire bug
Definitely. There has been a second fix, btw. - but I'll wait first to see if more comes up.
Re: A_M_Refire bug
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.
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.
- 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
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...