4.0.2 Bugs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Timo Pietilä
    Prophet
    • Apr 2007
    • 4096

    Ring of Open wounds does not impair HP recovery. I regen HP just fine with one of those on.

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9634

      Originally posted by Timo Pietilä
      Ring of Open wounds does not impair HP recovery. I regen HP just fine with one of those on.
      You should regen at half the rate - which is what I am seeing in testing.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • Timo Pietilä
        Prophet
        • Apr 2007
        • 4096

        Originally posted by Nick
        You should regen at half the rate - which is what I am seeing in testing.
        That's change from when they were introduced. Halving regen rate is OK, makes them useful again.

        Comment

        • PowerWyrm
          Prophet
          • Apr 2008
          • 2986

          equip_notice_after_time() induces useless equipment refreshes and has code that does nothing:

          Code:
          		for (flag = of_next(f, FLAG_START); flag != FLAG_END;
          			 flag = of_next(f, flag + 1)) {
          			if (!of_has(obj->known_flags, flag)) {
          				/* Message */
          				flag_message(flag, o_name);
          
          				/* Notice the flag */
          				object_notice_flag(obj, flag);
          
          				if (tval_is_jewelry(obj) &&
          					 (!object_effect(obj) || object_effect_is_known(obj))) {
          					/* Jewelry with a noticeable flag is obvious */
          					object_flavor_aware(obj);
          					object_check_for_ident(obj);
          					apply_autoinscription(obj);
          				}
          			} else {
          				[B]/* Notice the flag is absent */
          				object_notice_flag(obj, flag); <-- does nothing because of_has(obj->known_flags, flag) is TRUE[/B]
          			}
          		}
          	}
          
          	/* Notice new info */
          	[B]event_signal(EVENT_EQUIPMENT);<-- should only be done if something is noticed[/B]
          I would then change this code as follows:

          Code:
          bool redraw = FALSE;
          
          ...
          
          		for (flag = of_next(f, FLAG_START); flag != FLAG_END;
          			 flag = of_next(f, flag + 1)) {
          			if (!of_has(obj->known_flags, flag)) {
          				/* Message */
          				flag_message(flag, o_name);
          
          				/* Notice the flag */
          				object_notice_flag(obj, flag));
                                          redraw = TRUE;
          
          				if (tval_is_jewelry(obj) &&
          					 (!object_effect(obj) || object_effect_is_known(obj))) {
          					/* Jewelry with a noticeable flag is obvious */
          					object_flavor_aware(obj);
          					object_check_for_ident(obj);
          					apply_autoinscription(obj);
          				}
          			}
          		}
          	}
          
          	/* Notice new info */
          	if (redraw) event_signal(EVENT_EQUIPMENT);
          PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

          Comment

          • PowerWyrm
            Prophet
            • Apr 2008
            • 2986

            Just a little hidden bug when inspecting food. For example:

            - a ration of food has a "NOURISH" effect dice of 6000, which increases food counter by 6000
            - description is "When eaten, it feeds you for 6000 turns."
            - in process_world(), player digests turn_energy(player->state.speed) * 2 food units every 100 game turns
            - a player turn occurs every 100 / turn_energy(player->state.speed) game turns
            - this means that a player digests 2 food units every player turn
            - the description should then be "When eaten, it feeds you for 3000 turns."

            Tested with a 4.0.2 character, he goes from Hungry to Hungry again in 3000 standard (player) turns after eating a ration.

            Note: this doesn't take into account other influences on food consumption like regen or slow digestion, which also influence the turn count.

            Note that all the describe_food() code is now obsolete, since food value is now handled by the effect code.
            Last edited by PowerWyrm; October 23, 2015, 11:01.
            PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

            Comment

            • troycheek
              Rookie
              • Oct 2015
              • 12

              I don't know if this is new or not, but on Windows 7 if I try to automatically load a character by giving a command line of lib\user\save\CharacterName I immediately crash back to the desktop with "angbande.exe has stopped working." Same save file works fine if loaded with the Open command.

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9634

                Originally posted by troycheek
                I don't know if this is new or not, but on Windows 7 if I try to automatically load a character by giving a command line of lib\user\save\CharacterName I immediately crash back to the desktop with "angbande.exe has stopped working." Same save file works fine if loaded with the Open command.
                As I understand it the Windows port isn't designed to take command line input.
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • troycheek
                  Rookie
                  • Oct 2015
                  • 12

                  Originally posted by Nick
                  As I understand it the Windows port isn't designed to take command line input.
                  3.5.1 loaded save files through the command line just fine and I think I remember whichever 4.0 beta version I tried doing the same. 4.0.2 is trying to do something with the command line because it shows an error message "cannot find required file: CharacterName" if the specified path/file doesn't exist. Would it be difficult to re-add this function?

                  Edit: Okay, in main-win.c there's a section for static void check_for_save_file(LPSTR cmd_line) which appears to extract the savefile name from the command line, validate the savefile, and start the game. The code is identical to that which loads a savefile from the in-game menu. I think. I haven't done any serious C coding since the 1980s.

                  From check_for_save_file:

                  Code:
                  /* Validate the file */
                  validate_file(savefile);
                  /* Start game */
                  game_in_progress = TRUE;
                  Term_fresh();
                  play_game(FALSE);
                  quit(NULL);
                  From process_menus, the Open command (case IDM_FILE_OPEN):

                  Code:
                  /* Load 'savefile' */
                  validate_file(savefile);
                  /* Start game */
                  game_in_progress = TRUE;
                  Term_fresh();
                  play_game(FALSE);
                  quit(NULL);
                  Last edited by troycheek; October 24, 2015, 05:39.

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9634

                    Originally posted by troycheek
                    3.5.1 loaded save files through the command line just fine and I think I remember whichever 4.0 beta version I tried doing the same. 4.0.2 is trying to do something with the command line because it shows an error message "cannot find required file: CharacterName" if the specified path/file doesn't exist. Would it be difficult to re-add this function?
                    OK, I'm up to speed now

                    I can confirm this behaviour in Windows 10, whether a full path or relative path is given. Moreover, double-clicking on the savefile and then selecting angband to open it with comes up with "Cannot find required file", which looks like file_exists is failing (somewhat disappointing, since we started with the file).

                    My suspicion is that this is some arcane permissions issue - Windows is usually pretty good with not changing its API, but from 7 on they got more strict with where stuff could be run from, and we may be falling foul of that. Or something.

                    In any case, I think I'm going to have to file it as a bug, and tell you for now to just use the open dialogue, unless someone comes up with a better solution. I'm sorry if that messes up some system or other.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • Werbaer
                      Adept
                      • Aug 2014
                      • 182

                      Originally posted by troycheek
                      on Windows 7 if I try to automatically load a character by giving a command line of lib\user\save\CharacterName I immediately crash back to the desktop with "angbande.exe has stopped working." Same save file works fine if loaded with the Open command.
                      Originally posted by Nick
                      I can confirm this behaviour in Windows 10, whether a full path or relative path is given. Moreover, double-clicking on the savefile and then selecting angband to open it with comes up with "Cannot find required file", which looks like file_exists is failing (somewhat disappointing, since we started with the file).
                      To be able to find the file, you have to use the relative path as command line parameter
                      Code:
                      lib\user\save\filename
                      Using the full path, or using just the save file name, or using any file/path combination surrounded by "" doesn't work, and never worked (checked with 3.0.5).

                      But whether or not the file is found, angband crashes afterwards.

                      Comment

                      • Werbaer
                        Adept
                        • Aug 2014
                        • 182

                        Auotload character from command line:

                        In 3.5.0, in main_win.c:
                        Code:
                        static void check_for_save_file(LPSTR cmd_line)
                        {
                            [...]
                        	/* Set the command now so that we skip the "Open File" prompt. */
                        	cmd.command = CMD_LOADFILE;
                        }
                        In 4.0.0, in main_win.c:
                        Code:
                        static void check_for_save_file(LPSTR cmd_line)
                        {
                            [...]
                        	/* Start game */
                        	game_in_progress = TRUE;
                        	Term_fresh();
                        	play_game(FALSE);
                        	quit(NULL);
                        }
                        But take a look at the caller win_main() in main_win.c:
                        Code:
                        	/* Did the user double click on a save file? */
                        	check_for_save_file(lpCmdLine);
                        
                        	/* Set command hook */
                        	cmd_get_hook = textui_get_cmd;
                        
                        	/* Set up the display handlers and things. */
                        	init_display();
                        	init_angband();
                        
                        	textui_init();
                        
                        	initialized = TRUE;
                        check_for_save_file() is called before the various intialisation functions are executed. The was ok in the past, when it only set a command variable. Now that it tries to run the game immediately, this call needs to be moved after the initialisation is complete.

                        Comment

                        • Nick
                          Vanilla maintainer
                          • Apr 2007
                          • 9634

                          Thanks, I've filed that as a probable fix.
                          One for the Dark Lord on his dark throne
                          In the Land of Mordor where the Shadows lie.

                          Comment

                          • troycheek
                            Rookie
                            • Oct 2015
                            • 12

                            Thanks from me as well. I'd seen that in the 3.5 source but couldn't figure out what it meant.

                            Comment

                            • troycheek
                              Rookie
                              • Oct 2015
                              • 12

                              Assertion failed while breathing frost

                              Another bug! Actually, it's in 4.0.3 - should we start a new thread?

                              Assertion failed, file: obj-pile.c, line: 134, expression: pile_contains(*pile,obj)

                              Walked across a Potion of Dragon Breath. Quaffed it from the floor. Breathed frost at nearby baddies, close enough that the potion was within the damage radius. The Potion of Dragon Breath shatters! Game crashed with assertion failed. My guess would be that the game tried to remove the potion both when it shattered and when it was consumed, the second action causing the crash because the item in question had already been removed.

                              Comment

                              • Nick
                                Vanilla maintainer
                                • Apr 2007
                                • 9634

                                Originally posted by troycheek
                                Walked across a Potion of Dragon Breath. Quaffed it from the floor. Breathed frost at nearby baddies, close enough that the potion was within the damage radius. The Potion of Dragon Breath shatters! Game crashed with assertion failed. My guess would be that the game tried to remove the potion both when it shattered and when it was consumed, the second action causing the crash because the item in question had already been removed.
                                Confirmed, and correct guess.

                                New thread? I guess if someone feels strongly enough about that it will happen
                                One for the Dark Lord on his dark throne
                                In the Land of Mordor where the Shadows lie.

                                Comment

                                Working...
                                😀
                                😂
                                🥰
                                😘
                                🤢
                                😎
                                😞
                                😡
                                👍
                                👎