![]() |
#1 |
Apprentice
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
![]() |
summon monster type 0
I was playing around with the summon random monster command debug mode (^as), trying to test something I was working on. I thought it was supposed to summon ordinary monsters, and ^an was for uniques. I was surprised when I kept getting uniques from ^as, so I debugged into it.
If I'm not mistaken it looks like the top level call in wiz-debug.c: Code:
effect_simple(EF_SUMMON, source_player(), "1", 0, 0, 0, 0, 0, NULL); But because (I think) the parser is reversing the entries from summon.txt as it writes them to the fixed-size summons array, entry zero is not ANY as it probably used to be. Rather it's the last entry in summons.txt, UNIQUE. The result is that the code above always summons a unique as all the regular monsters get zero for their prob2 and prob3 values. It's not clear to me how many other places in the code there is an assumption that type 0 means ANY, since I can't find any #defines for this, and there aren't any calls anywhere to summon_name_to_idx("ANY"). It looks from grepping like there's at least one: chests with a summon-monster trap might always summon uniques too. That would probably count as a bug (assuming anything having to do with debug mode could be blown off as working-as-coded). A cheap and sleazy fix would be to move the ANY entry in summons.txt to the bottom and put in a comment saying it must be last. Or of course the parse could be changed to not reverse the entries by filling in the permanent array last-to-first as is done for some other things (and then add a comment to summon.txt saying ANY must be first). |
![]() |
![]() |
![]() |
#2 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,760
Donated: $60
![]() |
Thanks, bug filed.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Charm / Friendly Summon | Mark | Vanilla | 1 | April 14, 2019 14:56 |
read scroll of Summon Maintainer | Sky | Vanilla | 5 | October 24, 2017 11:55 |
Double height tiles: which type of cursor? | PowerWyrm | Development | 9 | July 26, 2012 13:52 |
I'm thinking some type of bug? Anyone agree? | Rei Tei | Vanilla | 3 | July 1, 2011 06:15 |
Blast! Killed by a "summon monster" trap | Wraitheist | Vanilla | 10 | April 27, 2008 18:36 |