Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop when reviving Cthulhu on a full level #9

Closed
tung opened this issue Jun 25, 2012 · 0 comments
Closed

Infinite loop when reviving Cthulhu on a full level #9

tung opened this issue Jun 25, 2012 · 0 comments
Assignees
Labels

Comments

@tung
Copy link
Owner

tung commented Jun 25, 2012

From http://nethackwiki.com/wiki/Talk:Cthulhu

If you fill the room up with them will Cthullu eventually lose his ablity to reform? Ndwolfwood 07:12, 15 June 2011 (UTC)

To answer your questions: [...]

  • Filling the level up with acid blobs: It crashes the game, although closing and reloading, he was no longer present. Probably not a good idea, since I don't know if that'll work every time. -Ion frigate 14:03, 15 June 2011 (UTC)

I looked into this, and found that if you kill Cthulhu and fill the level so he has nowhere to resurrect, the game will enter an infinite loop and will not respond to any player input.

The problem is actually two problems:

  • revive_cthulhu() in region.c calls enexto() to find a good spot to place Cthulhu, even though that should be done by makemon() when it's called.
  • If the above enexto() fails, revive_cthulhu() tells makemon() to place Cthulhu randomly, triggering an infinite loop within the latter when it tries to find a good random location, which it never will on an enemy-filled level.

What should happen is that makemon() should give up after not finding a good spot to make a monster (maybe after an enexto() to ensure no hard-to-find empty space is skipped), and revive_cthulhu() should leave positioning up to makemon().

@ghost ghost assigned tung Jun 25, 2012
@tung tung closed this as completed in 1f90e80 Jul 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant