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.
And in related news, i need a level editor to fix my savegame 8-(
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.
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();
}
Yeah, I will open a PR with this fix.
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.
The intention here was that the imp explodes and then freezes mid explosion, creating a weird statue of crystal.
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).