A_WeaponReady: WRF_USER1 (etc.)
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
Yeah I figured not but still... Hell if I know where to find it, honestly.
Re: A_WeaponReady: WRF_USER1 (etc.)
What's the issue at present? Should be able to get away with copying+pasting+renaming how the Reload and Zoom states do things, since it's the same thing.
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
Sorry! Found out what it was.
WeaponState is BYTE, and the flags for WF_USER#OKAY are 256 and above. Changing it to WORD fixed it. I hope this won't have any unforeseen consequences.
Pull Request and putting this on my first post on page 1.
WeaponState is BYTE, and the flags for WF_USER#OKAY are 256 and above. Changing it to WORD fixed it. I hope this won't have any unforeseen consequences.
Pull Request and putting this on my first post on page 1.
Re: A_WeaponReady: WRF_USER1 (etc.)
WeaponState is serialized. You'll need to explicitly load a byte for older versions.
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
(byte)WeaponState right?
Last edited by Major Cooke on Tue Dec 15, 2015 12:39 am, edited 2 times in total.
Re: A_WeaponReady: WRF_USER1 (etc.)
You'll want to test that, but yes that should do it.
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
Actually that doesn't work. Found something else that I think might though... Accuracy and stamina do this.
Code: Select all
if (SaveVersion < 4526)
{
BYTE oldWeaponState;
arc << oldWeaponState;
if (WeaponState != NULL)
{
WeaponState = oldWeaponState; //Shouldnt this be opposite? Looks like it should be but this is how accuracy and stamina did it...
}
}
else
{
arc << WeaponState;
}
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_WeaponReady: WRF_USER1 (etc.)
'That piece of code just looks wrong. If you deserialize an old savegame you should always set WeaponState. Like this:
Code: Select all
if (SaveVersion < 4526)
{
BYTE oldWeaponState;
arc << oldWeaponState;
WeaponState = oldWeaponState;
}
else
{
arc << WeaponState;
}
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
And done.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: A_WeaponReady: WRF_USER1 (etc.)
imho, you should keep the consistency with the | operator here.
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
No other flags are being passed into it. It's fine.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_WeaponReady: WRF_USER1 (etc.)
That may be, but it's bad style. Never use '+' with flag values, always use '|'. It's not the first time you did this and it was problematic in other cases. Better stop doing this altogether.
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
Alright, done. Anything else?
- Major Cooke
- Posts: 8212
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: A_WeaponReady: WRF_USER1 (etc.)
Randi has added this. This can be closed.