Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old July 16, 2011, 03:41   #1
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 485
bron is on a distinguished road
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.
bron is offline   Reply With Quote
Old July 16, 2011, 04:25   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,860
Donated: $60
Nick will become famous soon enough
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.
Nick is offline   Reply With Quote
Old July 16, 2011, 10:07   #3
CJNyfalt
Swordsman
 
Join Date: May 2007
Posts: 289
CJNyfalt is on a distinguished road
Thanks! Strangely doing this does not fix the same issue with Athletics and hitpoints.
CJNyfalt is offline   Reply With Quote
Old July 17, 2011, 00:29   #4
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 485
bron is on a distinguished road
Quote:
Originally Posted by CJNyfalt View Post
Thanks! Strangely doing this does not fix the same issue with Athletics and hitpoints.
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.
bron is offline   Reply With Quote
Old July 17, 2011, 10:26   #5
bron
Swordsman
 
Join Date: May 2008
Location: Saratoga, California (in the midst of Silicon Valley)
Posts: 485
bron is on a distinguished road
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.
bron is offline   Reply With Quote
Old July 19, 2011, 11:19   #6
CJNyfalt
Swordsman
 
Join Date: May 2007
Posts: 289
CJNyfalt is on a distinguished road
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.
CJNyfalt is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sangband wall fix for windows vista Malak Darkhunter Variants 41 May 10, 2010 21: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 03: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 15:42


All times are GMT +1. The time now is 02:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.