Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 28, 2011, 17:38   #21
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?
CunningGabe is offline   Reply With Quote
Old June 28, 2011, 21:54   #22
fizzix
Prophet
 
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,002
fizzix is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?
good work. I searched for a couple days for that bug and eventually gave up.
fizzix is offline   Reply With Quote
Old June 29, 2011, 19:09   #23
PowerDiver
Prophet
 
Join Date: Mar 2008
Posts: 2,712
PowerDiver is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
I did a little debugging, and I think I've found the problem. I put in a debug message to show the value of squelch_size when saving the game, and for me, that came out to be 0. It's supposed to be the number of entries in the squelch menu. In line 102 of squelch.c, squelch_size is set to be TYPE_MAX, which is defined in squelch.h. For some reason, that seems to be silently converted to 0 on some platforms -- maybe there's some unintentional type conversion somewhere?
The declaration of squelch_size in squelch.h is a variable definition rather than an extern. Thus, it creates a new variable initialized to 0 in each file that #includes squelch.h. Change const size_t squelch_size; to extern const size_t squelch_size; and I bet the problem will be fixed. Give it a try. I am surprised it normally works. I suppose a compiler could assume that an unitialized const ought to be an extern or the loader could combine multiple such produced in separate .o files. I am not knowledgable about what the standard says here.

This is yet another bug caused by copying data. I am a true believer in organizing code according to data, and it turns out that I submitted a fix years ago when I moved the code saving/loading the squelch table into squelch.c in part to eliminate the need for the variable squelch_size, but the heretics on the dev team follow some other religion.
PowerDiver is offline   Reply With Quote
Old June 29, 2011, 20:08   #24
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by PowerDiver View Post
The declaration of squelch_size in squelch.h is a variable definition rather than an extern. Thus, it creates a new variable initialized to 0 in each file that #includes squelch.h. Change const size_t squelch_size; to extern const size_t squelch_size; and I bet the problem will be fixed. Give it a try.
That worked all right! Good catch. I'll put in a pull request.
CunningGabe is offline   Reply With Quote
Old July 8, 2011, 09:51   #25
jens
Swordsman
 
Join Date: Apr 2011
Location: Göteborg, Sweden
Posts: 348
jens is on a distinguished road
I suggest a tweak on the default values for squelch.

Armours should not default to squelch bad.

When your worn armour gets damaged by acid it's set as squelch. No big problem so far. But when you start IDing new eq by wearing it you drop your damaged armour, and if your new armour is worse (e.g. you had on a 7,-1; you ID a 2, +1) you have to go through a whole little process to get that armour back. And the gain of starting of with all set to bad is quite negligible to start with. This only applies to armour though, so other items could still be set to squelch bad.
jens is offline   Reply With Quote
Old July 8, 2011, 16:24   #26
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,918
Derakon is on a distinguished road
I said in another thread that starting with squelch = bad is problematic to begin with. We don't want newbies to ID bad items and then have them suddenly and apparently irrevocably disappear from their inventories. Let them learn about squelch via the 'k' menu first.
Derakon is offline   Reply With Quote
Old July 8, 2011, 16:25   #27
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
Quote:
Originally Posted by Derakon View Post
I said in another thread that starting with squelch = bad is problematic to begin with. We don't want newbies to ID bad items and then have them suddenly and apparently irrevocably disappear from their inventories. Let them learn about squelch via the 'k' menu first.
I think Magnate agreed that people should not start with squelch = bad
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old July 8, 2011, 19:41   #28
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by d_m View Post
I think Magnate agreed that people should not start with squelch = bad
Yes, I'm going to revert this change in the next RC.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate 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
Verbose quality squelching msgs awldune Vanilla 0 February 17, 2010 17:18
Squelching vstat Vanilla 20 August 4, 2009 02:59
3.1 Bug in squelch by quality menu Skelwing Vanilla 1 April 11, 2009 20:20
3.1 bug: ego armor squelch quality ChodTheWacko Vanilla 1 April 11, 2009 20:19
Squelching DSM Colbey Vanilla 8 March 15, 2008 20:48


All times are GMT +1. The time now is 08:39.


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