A_M_Refire bug

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_M_Refire bug

Re: A_M_Refire bug

by Ed the Bat » Sun Jan 01, 2017 2:29 pm

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

Re: A_M_Refire bug

by Enjay » Sun Jan 01, 2017 10:36 am

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.

Re: A_M_Refire bug

by Graf Zahl » Sun Jan 01, 2017 10:34 am

Definitely. There has been a second fix, btw. - but I'll wait first to see if more comes up.

Re: A_M_Refire bug

by Rachael » Sun Jan 01, 2017 10:21 am

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.

Re: A_M_Refire bug

by Enjay » Sun Jan 01, 2017 10:12 am

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

Re: A_M_Refire bug

by Graf Zahl » Sun Jan 01, 2017 8:40 am

Yes, but that wasn't due to the state but that ignoremissile lost its default.

Re: A_M_Refire bug

by Enjay » Sun Jan 01, 2017 8:32 am

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.

Re: A_M_Refire bug

by Graf Zahl » Sun Jan 01, 2017 8:21 am

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);
		}
	}

A_M_Refire bug

by Enjay » Sun Jan 01, 2017 8:14 am

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.

Top