[r2168] HacX Item Count Bug
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.
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.
-
Deathlike2
- Posts: 317
- Joined: Wed Nov 03, 2004 10:17 am
[r2168] HacX Item Count Bug
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r2168] HacX Item Count Bug
I seriously doubt that this patch was made with perfect statistics in mind. It predates source ports with full statistics display.
Re: [r2168] HacX Item Count Bug
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?
Re: [r2168] HacX Item Count Bug
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
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.
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.
Re: [r2168] HacX Item Count Bug
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.
Here's a patch that fixes this bug.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r2168] HacX Item Count Bug
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.
Re: [r2168] HacX Item Count Bug
Okay.
Replace the check by this and it's fool-proof.
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.
Replace the check by this and it's fool-proof.
Code: Select all
if ((flags & RealPickup->flags) & MF_COUNTITEM)-
Deathlike2
- Posts: 317
- Joined: Wed Nov 03, 2004 10:17 am
Re: [r2168] HacX Item Count Bug
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.
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.
Re: [r2168] HacX Item Count Bug
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.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [r2168] HacX Item Count Bug
It's fixed now - but properly.