1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-06-07 21:32:10 +00:00

ru:: do not save static things such as moving platforms

This commit is contained in:
Zeno Rogue
2026-03-12 11:51:16 +01:00
parent f57fc060b9
commit e6ac7fe911
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -350,6 +350,8 @@ struct entity {
virtual void on_reset_all() {}
entity *hal();
virtual bool nonstatic() { return true; }
};
struct weaponmod {
@@ -453,7 +455,8 @@ struct moving_platform : public entity {
virtual moving_platform* as_platform() { return this; }
string get_name() override { return "moving platform"; }
string get_help() override { return "Moving platforms move."; }
};
bool nonstatic() override { return false; }
};
struct ferris_platform : public moving_platform {
xy location_at(ld t) override;
+1 -1
View File
@@ -73,7 +73,7 @@ void save_as(string fname) {
for(int x=0; x<room_y; x++) if(r.block_at[y][x] != r.orig_block_at[y][x])
println(f, "AT ", y, " ", x, " ", r.block_at[y][x]);
for(auto& e: r.entities) save_via_stater(f, *e, "ENTITY");
for(auto& e: r.entities) if(e->nonstatic()) save_via_stater(f, *e, "ENTITY");
if(r.timed_orb_end >= gframeid) println(f, "TIMER ", r.timed_orb_end);
println(f);