![]() |
#1 |
Knight
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 515
![]() |
Oangband bug fix
So I was playing in the recent Oangband Shadow Fairy Mage competition, and I was annoyed by a bug I kept hitting: if I was a full mana, and then saved the game (cntrl-X), when I restored it I had less than full mana. It annoyed me enough that I tracked it down: in update_stuff() in file xtra1.c, the call to calc_mana() comes *before* the call to calc_specialty(). This means that the very first time calc_mana() is called after a savefile reload, the value of p_ptr->specialties_allowed has not yet been updated and so is still zero. This in turn means that the bonus for having the "Clarity" special ability isn't being counted the first time that calc_mana() is called.
The fix that I chose is simple: I just moved the block of code that checks for and calls calc_speciality to be the first such block in the update_stuff() routine. |
![]() |
![]() |
![]() |
#2 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 58
Posts: 9,564
Donated: $60
![]() ![]() |
Cool, thanks - O110u isn't very well maintained, I'm afraid.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#3 |
Swordsman
Join Date: May 2007
Posts: 289
![]() |
Thanks! Strangely doing this does not fix the same issue with Athletics and hitpoints.
|
![]() |
![]() |
![]() |
#4 |
Knight
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 515
![]() |
That is odd. I'm not surprised that similar issues would exist for other specialties; I'm surprised this doesn't fix them as well. Having just pawed through the code for my problem, I'd be happy to look at this case as well if you have a savefile that shows the problem (e.g. I load the character, rest to full HP <or whatever>, save, restore, and the attribute falls). No guarantees of course.
|
![]() |
![]() |
![]() |
#5 |
Knight
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 515
![]() |
OK, so I just now created a Warrior character with the Athletics specialty. With the original code, I see the analogous problem. But for me, the fix I proposed does also fix the problem for Athletics. There are lots of possibilities here, but let's start with the simple one: if you load a savefile, and see that it has too few HP, and then save the character again, the savefile will now have the lower number of HP, and fixing the problem that caused it in the first place will not change the number of HP in the savefile. So please try: (1) apply the fix to update_stuff, moving the "if" block that includes calc_specialties to the top. (2) load the old save file, then rest to get up to full HP, (3) Now save, with the character at full HP, which will correct the number of HP in the savefile, and then (4) restore.
If this still doesn't work, something more subtle is wrong. |
![]() |
![]() |
![]() |
#6 |
Swordsman
Join Date: May 2007
Posts: 289
![]() |
Yes, I did exactly like that, and it didn't work.
Still, I got an idea on where the issue might be. First, I have a different version than 1.1.0u, at first I saw no reason how that should matter. However, one of the differences is that 1.1.0 has the menu to load savefiles from, and displays the character screen when loading a character. I noticed that the maximum hitpoints was too low on this screen. So, it looks to me that said screen is displayed before any call to update_stuff. It seems like I need to insert a call to update_stuff somewhere. The exact place is still unknown. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sangband wall fix for windows vista | Malak Darkhunter | Variants | 41 | May 10, 2010 20:35 |
a fluke or an unfixed fix 3.1.2 | yyrkoon | Vanilla | 11 | February 20, 2010 01:20 |
Little (and quick-fix) 3.1.0 issues | ClaytonAguiar | Vanilla | 7 | June 23, 2009 02:43 |
Is someone going to fix rephial.org? | ChodTheWacko | Vanilla | 3 | March 18, 2009 23:40 |
Any way to fix the Esc problem for Linux? | TJA | Vanilla | 6 | August 17, 2007 14:42 |