A_Chase doesn't accept "" for missing state

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
MartinHowe
Posts: 2078
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

A_Chase doesn't accept "" for missing state

Post by MartinHowe »

I have a monster that has only a melee attack but want flag 16 ("stay still"). When specifying the missile state:

Using BOSS C 2 A_Chase("Melee", "" , 16) gives a "negative jump offset" error.
Using BOSS C 2 A_Chase("Melee", None, 16) gives a "string constant expected" error.
Using BOSS C 2 A_Chase("Melee", Null, 16) gives a "string constant expected" error.
Using BOSS C 2 A_Chase("Melee", "NULL", 16) works, but only because "NULL" is an undefined state label and the log file is littered with errors to that effect.
Using BOSS C 2 A_Chase("Melee", 0, 16) gives a "negative jump offset" error.

If the official way to specify "there isn't one" for one of the states is broken, please fix it :)
If there is no official way to specify "there isn't one" for one of the states, please add one :)
If there is, please tell me what it is.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Chase doesn't accept "" for missing state

Post by Graf Zahl »

"" is supposed work. The problem is simple: It checks for the name constant 0 - which unfortunately is not "" as one might think but "none". But please DO NOT use that! This has been annoying me for ages so I'm going to change it to "" as it should be.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: A_Chase doesn't accept "" for missing state

Post by Matt »

Graf Zahl wrote:"" is supposed work. The problem is simple: It checks for the name constant 0 - which unfortunately is not "" as one might think but "none". But please DO NOT use that! This has been annoying me for ages so I'm going to change it to "" as it should be.
Does this apply to other strings that can take null values (e.g., certain sound specifications and cancelling out inherited properties)?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Chase doesn't accept "" for missing state

Post by Graf Zahl »

A_Chase was a special case because it needs a (none) value. But for sounds it's essentially the same but there specifying a non-existing sound was the same as specifying nothing so it didn't matter.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: A_Chase doesn't accept "" for missing state

Post by randi »

Oh? That's why you did that? In that case, sorry, but I'm reverting your change. 'None' was always meant to represent nothing in the name table, not ''.

In this case, as far as I can tell, the real bug is that SC_CheckNumber() considered "" to be the number 0, so the example usage with "" was being treated as if 0 had been used instead.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Chase doesn't accept "" for missing state

Post by Graf Zahl »

It didn't work anyway. I fixed it for real now by making offset 0 and the empty strings synonymous for 'no state passed'.
Post Reply

Return to “Closed Bugs [GZDoom]”