Mirror Imp death replaces staircases

Feb 11, 9:08 am
#1
Joined: Dec 19, 2018
Occupation: Pharmacy Tech
Location: USA
Interests: ZZT, Roleplaying,
Posts: 79
I have found a bug in vanilla 0.59, a very nasty one that deletes staircases!

If a mirror imp croaks exactly on the stairs it replaces the tile with the crystal they leave and an engraving describing the staircase.
Energizer - you are invincible
ZZT @narchists unite! Turn off the dark, get free money, defeat death itself!
Feb 11, 9:16 am
#2
Joined: Dec 19, 2018
Occupation: Pharmacy Tech
Location: USA
Interests: ZZT, Roleplaying,
Posts: 79
And in related news, i need a level editor to fix my savegame 8-(
Energizer - you are invincible
ZZT @narchists unite! Turn off the dark, get free money, defeat death itself!
Feb 11, 9:55 am
#3
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 836
Oops! Added here: https://github.com/Attnam/ivan/issues/664

If you turn on wizard mode, you can level-teleport. Or if you haven't played much/saved, maybe if you force-close your game and load a quicksave, you will be back before that happened.
Feb 11, 9:02 pm
#4
Joined: Sep 5, 2010
Interests: make more ivans!
Posts: 310
the easiest fix, btw, is this:
void mirrorimp::CreateCorpse (lsquare *Square) {
  // do not replace any interesting terrain
  if (!Square->GetOLTerrain()) {
    decoration *Shard = decoration::Spawn(SHARD);
    Shard->InitMaterials(MAKE_MATERIAL(GLASS));
    Square->ChangeOLTerrainAndUpdateLights(Shard);
  }
  SendToHell();
}
Feb 12, 3:34 am
#5
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 836
Yeah, I will open a PR with this fix.
Feb 12, 5:37 am
#6
Joined: Sep 5, 2010
Interests: make more ivans!
Posts: 310
maybe we can create a new item instead, "crystalshard", or something. currently, crystals are "digged" to stones, but imp may explode into much smaller "crystal shards". or even special kind of fluid, so it cannot be picked up, but can emit light, and can be spilled around — because small crystal shards are very close to "fluids", actually.

maybe i'll try to experiment with this later.
Feb 12, 6:32 am
#7
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 836
The intention here was that the imp explodes and then freezes mid explosion, creating a weird statue of crystal.
Feb 12, 3:25 pm
#8
Joined: Sep 5, 2010
Interests: make more ivans!
Posts: 310
ah. then maybe crystal statue as an item then? that is, so it can freely spawn above special terrain. we can check and don't spawn statue if there is another one already, to not make light emitation too bright.

of course, the bugfix works too, but with it, no crystals could be spawned above an open door, for example, or sofa, or fountain, or any other decoration. it is safe this way, but slightly less interesting, i think.

it is possible to change the code a little, and prevent spawning only over "important" olterra too, i actually implemented this fix first. maybe it is better than a new item, dunno…

p.s.: it is easy — just add `IsImprotant()` method to olterra, and make it return `true` for stairs. and check it in `ChangeOLTerrainAndUpdateLights()` (and don't forget to `delete` new terrain if update failed).
Jump to