Anonymous | Login | 2024-04-26 11:47 CEST |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||||
0003839 | [DCSS] Bug Report | minor | random | 2011-04-20 06:22 | 2014-07-02 19:01 | ||||||||
Reporter | reid | View Status | public | ||||||||||
Assigned To | wheals | ||||||||||||
Priority | normal | Resolution | done | ||||||||||
Status | resolved | Product Branch | 0.8 ancient branch | ||||||||||
Summary | 0003839: monster_teleport can teleport a monster to an illegal square | ||||||||||||
Description |
From mon-stuff.cc: if (newpos.origin()) monster_random_space(mons, newpos, !mons->wont_attack()); // XXX: If the above function didn't find a good spot, return now // rather than continue by slotting the monster (presumably) // back into its old location (previous behaviour). This seems // to be much cleaner and safer than relying on what appears to // have been a mistake. if (newpos.origin()) return; But monster_random_space indicates failure by its return value, not by failing to modify its second argument. The result is that if monster_random_space fails to find a legal square to teleport the monster to, the last square it tries will be used as the teleportation target. This is usually unlikely, since monster_random_space tries 1000 times to find a legal (unoccupied, habitable by the monster in question, etc.) square. But it can plausibly, if not usefully, happen in a real game: for example, you could fill a treasure trove with jellies from Jiyva's first ability, and teleport one of them; it'll probably land in a wall, but it could land on another jelly (or the player character!) in which case I don't know what would happen--I wouldn't be surprised if the game crashes. In wizard mode you can also create a salamander with &M and then teleport it into a wall or deep water, with hilarious results. |
||||||||||||
Additional Information | |||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files | |||||||||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |