[0.8-1988-g1b24ed3] Segfault when sleeping while hallucinating

I went into the shelter basement, took LSD, waited until the hallucinations started, took sleeping pills until I was tired and slept.

Program received signal SIGSEGV, Segmentation fault 0x083d9ffd in monster::monster (this=0xbfffead0, t=0x73676e69) at monster.cpp:57 57 moves = type->speed; (gdb) bt #0 0x083d9ffd in monster::monster (this=0xbfffead0, t=0x73676e69) at monster.cpp:57 #1 0x08156242 in game::spawn_hallucination (this=0xb7a30008) at game.cpp:5776 #2 0x080f80f9 in handle_deliriant (p=..., dis=...) at disease.cpp:2649 #3 0x080eb7f0 in dis_effect (p=..., dis=...) at disease.cpp:1014 #4 0x084a7b38 in player::suffer (this=0xb7a811a0, g=0xb7a30008) at player.cpp:4430 #5 0x081319a1 in game::do_turn (this=0xb7a30008) at game.cpp:723 #6 0x08291bd3 in main (argc=0, argv=0xbffff3b8) at main.cpp:102

I think the issue here is that in MonsterGenerator::get_valid_hallucination()

rng(x,y) is [x,y] so sometimes it will access outside the bounds of the array.

Inclusive on both ends, right. Accursed off-by-one error!

I’ll admit, that was my mistake. I’ll get it fixed ASAP; thanks for reporting.