Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Variants (http://angband.oook.cz/forum/forumdisplay.php?f=4)
-   -   PosChengband bug - game hangs at midnight (http://angband.oook.cz/forum/showthread.php?t=8570)

Sideways September 24, 2017 17:31

PosChengband bug - game hangs at midnight
 
PosChengband repeatedly hung at midnight on my latest character, and I managed to figure out what the problem was.
(I was playing 6.1.0, but this bug affects many other versions as well, including the current PosChengband and elliposchengband masters.)

If you spend midnight in Chameleon Cave and your max depth is at least 42, determine_today_mon() (the function responsible for selecting the new wanted monster of the day) gets stuck in an infinite loop. The problem is that because the player is in Chameleon Cave, get_mon_num() only ever returns two monsters - Chameleon and Chameleon Lord - to determine_today_mon(); but neither of those can be wanted monster of the day, Chameleon Lord because he's a unique and regular chameleon because it's too low-depth compared to the player's maximum depth. There's no sanity check that says "we've tried this loop 5,000 times and didn't get a valid monster", so the loop just keeps trying infinitely and the game hangs.

If this bug happens to you, probably the easiest way to get around it is to edit r_info.txt and temporarily modify the regular chameleon's depth so it survives the check that says "if (r_ptr->level < MIN(max_dl / 2, 40)) continue;"; that way, you won't have to modify and recompile the source code like I did.

HugoTheGreat2011 September 24, 2017 18:07

Good catch, Sideways!


All times are GMT +1. The time now is 18:06.

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