Project

General

Profile

Bug #661

New armour bug: blue and green armour add

Added by stefansteck about 13 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
2009-04-05
% Done:

100%


Description

In Doom, picking up green armour, some helmets and blue armour after one another results in having an armour value of more than 300%. Actually, armour addition should stop at 200%. Tested in Doom2 with high-res textures and models activated. This bug seems to be a result of the fix of bug #2642596.

Labels: Gameplay

History

#1 Updated by xrdvx about 13 years ago

Maybe caused because the armor is added totally and not point by point... If the armor points are added one by one, you can stop them at 200%...

I'm just speculating... Of course that will cause more usage of computer resources, but, is a solution.

Other way, is make: 200 - (added armor + actual armor): if added armor + actual armor is bigger than 200, then set actual armor to 200, if less or equal, just pust the result of the (added + actual).

There you got another solution.

#2 Updated by xrdvx about 13 years ago

I just founded that bug... and as far as i see, i did the same, but the green one was picked on the lvl one and the helmets and blue armor on lvl 2.

Here you can see the issue: http://etii.webs.com/extraarmorbug.JPG

#3 Updated by skyjake about 13 years ago

(originally posted by anonymous SF.net user)

Looks to me like P_GiveArmor in p_inter.c is simply behaving incorrectly. P_GiveArmor is called in three cases in jDoom; on picking up the green armor, the blue armor, or the megasphere. The green armor makes your armor total exactly 100 if it was less; the blue armor and the megasphere make your armor total exactly 200 if it was less. None of them adds any fixed amount to your armor total.

As such, P_GiveArmor should call P_PlayerGiveArmorBonus(plr, points - plr->armorPoints) and not P_PlayerGiveArmorBonus(plr, points). The check above already ensures that this value will be positive, and the 200 cap is maintained, not artificially, but because the blue armor gives 200. The armor bonus has its own check, which is also against the blue armor, and which doesn't need fixing.

Anyway, I can confirm from other ports and from testing that this is the correct fix for jDoom. I believe the exact same one line fix to P_GiveArmor is also correct for jHeretic and jHexen but I can't promise :)

#4 Updated by skyjake about 13 years ago

(originally posted by anonymous SF.net user)

(incidentally I'd be happy to include a patch but either I don't have permission, or sourceforge's UI totally sucks. Either way, sorry. It's a oneliner change anyway.)

#5 Updated by danij about 13 years ago

Fixed in svn for 1.9.0-beta6.2

Also available in: Atom PDF