Alertness DV bonus bug
issueid=755 02-22-2012 08:49 PM
Ancient Member
Number of reported issues by anon123: 111
Alertness DV bonus bug
The minor DV bonuses the Alertness skill grants don't work as the manual states.

Problem
The DV bonuses granted by having the Alertness skill on a certain level don't work as the manual says they do. The manual says Alertness gives +1 DV at 75+ skill, +2 at 90+ and +4 at 100, but according code-dived information it works like this:
* If Alertness is above 75 and the PC has the Alchemy skill: +4 DV
* If Alertness is above 90 and the PC doesn't have the Alchemy skill: +2 DV
* If Alertness is between 75 and 90 and the PC doesn't have the Alchemy skill: +1 DV

How to reproduce it
See above.

Notes
See above.
Issue Details
Issue Number 755
Project ADOM (Ancient Domains Of Mystery)
Category Windows NT
Status Cannot Reproduce
Priority 9
Affected Version Unknown
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




12-11-2012 12:31 PM
The Creator
I am sorry but your code diving skill check has failed:

if (GetSkill(SK_ALERTNESS) >= 75)
{
if (GetSkill(SK_ALERTNESS) == 100)
dv += 4;
elseif (GetSkill(SK_ALERTNESS) >= 90)
dv += 2;
else
dv++;
}

12-11-2012 12:41 PM
Ancient Member
Hah, that's a great response :)

12-11-2012 01:17 PM
Ancient Member
Quote Originally Posted by adom-admin
I am sorry but your code diving skill check has failed:

if (GetSkill(SK_ALERTNESS) >= 75)
{
if (GetSkill(SK_ALERTNESS) == 100)
dv += 4;
elseif (GetSkill(SK_ALERTNESS) >= 90)
dv += 2;
else
dv++;
}
from old logs of mine
Code:
Start [no alchemy, alertness at 56] -8/18/30 [berserk/normal/coward]
Alchemy goes up: no changes
Alertness to 74[no other skills of interest changed].. same
Alchemy goes up…. Same as before
Alertness to 75 – 8/19/31
Alchemy wished 10/22/36
Alchemy maxed…
Alertness to 90 [and 95] 9/20/33
Alchemy wished 10/22/36
Alertness to 100 9/20/33
Alchemy wished upon 10/22/36
Other way around 90 Alertness + Maxed Alchemy when Maxed Alertness [this caused some problem in pilot test] same…
Same + change class to assassin = same final values…
Well if we evaluate Dv at Normal [which is what manual refers to], when it looks like +1 on 75Alertnes, +2 on 90… +4 bonus at 100 was not were in test, instead you get another +2DV via alchemy… Actually Alchemy max out you DV bonus as soon as you get any bonus…
As far as I am involved I sense another bug of doing wrong check… In particular it looks like instead checking for Alertness at 100 game checks at Alertnes>75+Alchemy…
So hate to say but I suggest less sarcasm and more code cleaning.

12-11-2012 01:30 PM
Senior Member
Quote Originally Posted by adom-admin
I am sorry but your code diving skill check has failed:

if (GetSkill(SK_ALERTNESS) >= 75)
{
if (GetSkill(SK_ALERTNESS) == 100)
dv += 4;
elseif (GetSkill(SK_ALERTNESS) >= 90)
dv += 2;
else
dv++;
}
Just a thought, but given Soirana's response, could the culprit perhaps be the GetSkill function? If it's accidentally pulling information from Alchemy as well as Alertness (which seems plausible, since they're adjacent skills), it might cause the observed behaviour.

12-11-2012 01:38 PM
Ancient Member
Or perhaps both skills are defined with the same constant. Something like

int SK_ALCHEMY = 1;
int SK_ALERTNESS = 1;
int SK_AWARENESS = 2;
...

+ Reply