Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001852Zandronum[All Projects] Bugpublic2014-06-21 14:442024-03-11 08:02
ReporterHypnotoad 
Assigned ToKaminsky 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version1.2 
Target Version3.1Fixed in Version3.1 
Summary0001852: Clearinventory() causes faulty armor behaviour
DescriptionIf you put clearinventory() in an enter script in a map, Zandronum will seem to initially have trouble tracking your armor type when you pick up green or blue armor afterwards, causing GetArmorType() to fail (I suspect other things also fail as I've been having trouble with odd armor behaviour in a mod I'm working on, but GetArmorType() failing I can reproduce 100% so far).

I've attached a test wad to demonstrate, see the steps to reproduce section to see how GetArmorType() fails. This error does NOT occur in GZDoom 1.8.2, but does occur in Zandronum 1.3 and 2.0.

This can be annoying if a mod wants to save a player's armor and then restore it at a later time for instance, because it could cause the armor saving to fail at saving the correct type of armor. I believe, though am not yet 100% certain, that this same bug causes the decorate function A_JumpIfArmorType to fail also.
Steps To ReproduceSimply walk over the green or blue armor while being sure not to pick up any armor bonuses, and you'll notice your green or blue armor count wont increase, the count will work once you pick up different armor (e.g. picking up blue armor after first picking up green). On the other hand, if you comment out the clearinventory() from the script, or if you pickup an armorbonus beforehand first, then the count will show correctly as normal.
Attached Files? file icon armortest.wad [^] (8,695 bytes) 2014-06-21 14:44

- Relationships

-  Notes
User avatar (0009718)
Catastrophe (reporter)
2014-06-23 19:21

This happens in all out war.
User avatar (0009878)
Edward-san (developer)
2014-07-06 11:29

What about GZDoom 1.5.0 (the current codebase of latest 2.0 beta build)?
User avatar (0009880)
Hypnotoad (reporter)
2014-07-06 15:56

It works in that build, could not reproduce the bug in it.
User avatar (0010606)
Watermelon (developer)
2014-10-16 00:27
edited on: 2014-10-16 00:27

@Torr

The following NETWORK_InClientMode() causes this to not work.

Quote
// [BB] Don't delete BasicArmor, just clear it. Probably ZDoom should do it like this
            // as well, but to be on the safe side only do this on the client for now.
            else if ( NETWORK_InClientMode() && ( inv->GetClass() == RUNTIME_CLASS(ABasicArmor) ) )
            {
                ABasicArmor *barmor = static_cast<ABasicArmor *> (inv);
                barmor->SavePercent = 0;
                barmor->Amount = 0;
            }


When I comment it out like /* NETWORK_InClientMode() */ it works, but I'm unsure if there's a reason you have that there?

Offline it fails because NETSTATE is single/single with bots.

User avatar (0010611)
ZzZombo (reporter)
2014-10-16 07:37

"Probably ZDoom should do it like this as well", I think that's the only reason. The code is originated from ZDoom.
User avatar (0010612)
Watermelon (developer)
2014-10-16 12:24
edited on: 2014-10-16 12:24

Quote
"Probably ZDoom should do it like this as well", I think that's the only reason. The code is originated from ZDoom.


I don't think you read my post. The problem is it being the wrong net state when being triggered which results in clearing anyways (which didn't originate from ZDoom at all).

User avatar (0010638)
Watermelon (developer)
2014-10-19 23:41

Interesting:

So ZDoom does in fact still actually wipe out ABasicArmor, but picking up GreenArmor appears to return it to the inventory. I can't seem to find where it does this in ZDoom though...

Thus, to keep in line with ZDoom, is it possible to have GreenArmor picks give the player ABasicArmor if the player doesn't have it? That seems to be what ZDoom is doing.
User avatar (0017949)
Hypnotoad (reporter)
2017-06-28 19:02

This is still happening in the latest beta.
User avatar (0018555)
Leonard (developer)
2017-10-14 12:52
edited on: 2017-11-10 16:36

I pushed some commits for this but I would need some input regarding GZDoom delta (I left comments on the commits).

EDIT: Changed the commits link (I'm no longer going to use my old repository so away it goes).

User avatar (0020034)
Ivan (reporter)
2018-10-08 21:00

Happens with 3.1 build released here as well'https://zandronum.com/forum/viewtopic.php?f=55&t=9340 [^]'
User avatar (0021634)
Kaminsky (developer)
2021-07-23 21:15

This should've been fixed in 3.1 with this commit:'https://osdn.net/projects/zandronum/scm/hg/zandronum-stable/commits/55bd7a828820d2691c9768f5dd506c9b538d9b2b [^]'
User avatar (0023350)
unknownna (updater)
2024-03-11 08:02

The example wad works fine in 3.1. The messages update accordingly when you pick up the armors compared to before. Great work.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: Hypnotoad Catastrophe WaTaKiD
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2014-06-21 14:44 Hypnotoad New Issue
2014-06-21 14:44 Hypnotoad File Added: armortest.wad
2014-06-23 19:21 Catastrophe Note Added: 0009718
2014-07-05 10:17 Torr Samaho Product Version 2.0-beta => 1.3
2014-07-05 10:17 Torr Samaho Product Version 1.3 => 1.2
2014-07-06 11:29 Edward-san Note Added: 0009878
2014-07-06 12:57 Dusk Status new => feedback
2014-07-06 15:56 Hypnotoad Note Added: 0009880
2014-07-06 15:56 Hypnotoad Status feedback => new
2014-10-12 17:20 Watermelon Assigned To => Watermelon
2014-10-12 17:20 Watermelon Status new => assigned
2014-10-16 00:27 Watermelon Note Added: 0010606
2014-10-16 00:27 Watermelon Status assigned => needs review
2014-10-16 00:27 Watermelon Note Edited: 0010606 View Revisions
2014-10-16 07:37 ZzZombo Note Added: 0010611
2014-10-16 12:24 Watermelon Note Added: 0010612
2014-10-16 12:24 Watermelon Note Edited: 0010612 View Revisions
2014-10-19 23:41 Watermelon Note Added: 0010638
2014-10-23 16:44 Watermelon Assigned To Watermelon =>
2014-10-23 16:44 Watermelon Status needs review => confirmed
2017-06-28 19:02 Hypnotoad Note Added: 0017949
2017-10-14 12:52 Leonard Note Added: 0018555
2017-10-14 12:52 Leonard Assigned To => Leonard
2017-10-14 12:52 Leonard Status confirmed => needs review
2017-10-14 12:52 Leonard Target Version => 3.1
2017-11-10 16:36 Leonard Note Edited: 0018555 View Revisions
2018-10-08 21:00 Ivan Note Added: 0020034
2021-07-23 21:15 Kaminsky Note Added: 0021634
2021-07-23 21:15 Kaminsky Assigned To Leonard => Kaminsky
2021-07-23 21:15 Kaminsky Status needs review => needs testing
2024-03-11 08:02 unknownna Note Added: 0023350
2024-03-11 08:02 unknownna Status needs testing => resolved
2024-03-11 08:02 unknownna Fixed in Version => 3.1
2024-03-11 08:02 unknownna Resolution open => fixed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker