[Not a bug] Weapon destroys after trying of change state duration

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Weapon destroys after trying of change state duration

Postby Apeirogon » Mon Feb 04, 2019 7:07 am

Load example, type in console give boom_stick, choose it at number one, shot several times, release fire button, weapon disappear without any message.
Comment line 25 to prevent this to happening.
Attachments
set tick bug.wad
(718 Bytes) Downloaded 13 times
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Weapon destroys after trying of change state duration

Postby Graf Zahl » Mon Feb 04, 2019 7:16 am

You are setting the duration of the item itself, not the HUD sprite!

As long as an inventory item is owned it is displaying the 'held' state which has infinite duration. This state still gets ticked, though, and if its duration expires without a follow-up state the item will vanish.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Weapon destroys after trying of change state duration

Postby Arctangent » Mon Feb 04, 2019 12:04 pm

Graf Zahl wrote:As long as an inventory item is owned it is displaying the 'held' state which has infinite duration. This state still gets ticked, though, and if its duration expires without a follow-up state the item will vanish.

Is this intentional behavior, or more just an aftereffect that might get unintentionally changed later on?

Could be a simple way to do time-limited weapons or such if it is reliable, which is an interesting thought.
User avatar
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: Weapon destroys after trying of change state duration

Postby Rachael » Mon Feb 04, 2019 12:08 pm

The problem is, it leaves the player with a null weapon, which historically hasn't always proven stable in the game. But maybe I am wrong - maybe it's intentional to allow that.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: Weapon destroys after trying of change state duration

Postby Graf Zahl » Mon Feb 04, 2019 12:23 pm

The main issue here is that what he did qualifies as 'Don't do that'. There are legitimate reasons to allow owned weapons to run through their normal states, but mucking around with their duration is something the code cannot deal with.

I far more suspect a case of user error here, i.e. he wanted to alter the PSprite's duration - and for that it was just dead wrong.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests