[r2168] HacX Item Count Bug

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
Deathlike2
Posts: 317
Joined: Wed Nov 03, 2004 10:17 am

[r2168] HacX Item Count Bug

Post by Deathlike2 »

HacX - http://www.doomworld.com/idgames/?id=14031

When picking up the Force Field (Invincibility Item) and Dampener (Armor Bonus), the Total Item Count is also incremented when it shouldn't.

I believe the dehacked patch has some influence over this as not including the file causes the count to be correct.

I'm unsure if the patch is buggy or whether ZDoom is processing it correctly.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r2168] HacX Item Count Bug

Post by Graf Zahl »

I seriously doubt that this patch was made with perfect statistics in mind. It predates source ports with full statistics display.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [r2168] HacX Item Count Bug

Post by Gez »

Are there any other port than ZDoom that displays stats during game? Or that can be set to display a Heretic-like numerical count instead of a percentile value on the intermission screen?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [r2168] HacX Item Count Bug

Post by Gez »

Actually a bug. Here's a simple level I used for comparison. In Eternity you can get 100% items by grabbing the four armor bonus before hitting the exit switch-like thing.
Deathlike2
Posts: 317
Joined: Wed Nov 03, 2004 10:17 am

Re: [r2168] HacX Item Count Bug

Post by Deathlike2 »

Doomsday has options to show the actual #s like ZDoom does.

Edit:

Tried it with Doomsday and the dehacked patch works fine, so I think it's a fair assumption it is a bug with ZDoom.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [r2168] HacX Item Count Bug

Post by Gez »

This is completely a ZDoom bug and not a problem with the dehacked patch. ZDoom uses [wiki=Classes:DehackedPickup]these guys[/wiki] to handle pickups that have been modified by dehacked. And when they're picked up, they spawn the real pickup to which they correspond, in order to give it to the player. What happens then if you "dehack" a countitem pickup to make a countitem pickup? You end up with the item being counted twice (once when map spawned, and another time when picked up) and only picked-up once.

Here's a patch that fixes this bug.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r2168] HacX Item Count Bug

Post by Graf Zahl »

Isn't the check you make incomplete? What if the actual item has the flag but the replacement does not? Your code would screw the counter if I read it correctly.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [r2168] HacX Item Count Bug

Post by Gez »

Okay.

Replace the check by this and it's fool-proof.

Code: Select all

if ((flags & RealPickup->flags) & MF_COUNTITEM)
Might be better to call DetermineType in BeginPlay or PostBeginPlay so as to remove the flag and decrease the counter there if a dehacked patch does something like turn an armor bonus into a keycard. But this is a simpler change.
Deathlike2
Posts: 317
Joined: Wed Nov 03, 2004 10:17 am

Re: [r2168] HacX Item Count Bug

Post by Deathlike2 »

Any updates on this, or is testing still needed for this?

I guess it's worth posing the question, but is the armor pickup (and invulnerability) being reused as something else and it's replaced by some other thing, or is there something that I'm not understanding?

I ask this because the health bonus works just fine... like many of the existing items.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [r2168] HacX Item Count Bug

Post by Gez »

The "BON2 A" state was altered to loop on itself rather than go to BON2 B. As a result, the actor is modified, and replaced by a DehackedPickup as I explained above. Most other count items haven't been altered, so they're not replaced by dehacked pickups.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r2168] HacX Item Count Bug

Post by Graf Zahl »

It's fixed now - but properly.
Post Reply

Return to “Closed Bugs [GZDoom]”