1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 23:10:26 +00:00

fixed a weird crash in guided tour

This commit is contained in:
Zeno Rogue 2020-07-13 00:07:39 +02:00
parent 7deb98154f
commit b87f051b3f

View File

@ -36,6 +36,18 @@ struct gamedata {
} }
index += ssize; index += ssize;
} }
template<class T> void store_ptr(T& x) {
T* copy;
if(mode == 0) {
copy = new T;
*copy = move(x);
}
store(copy);
if(mode != 0) {
x = move(*copy);
delete copy;
}
}
}; };
#endif #endif
@ -49,7 +61,7 @@ void gamedata_all(gamedata& gd) {
gd.store(chaosmode); gd.store(chaosmode);
gd.store(*current_display); gd.store(*current_display);
gd.store(cgip); gd.store(cgip);
gd.store(vid); gd.store_ptr(vid);
gd.store(sightrange_bonus); gd.store(sightrange_bonus);
gd.store(genrange_bonus); gd.store(genrange_bonus);
gd.store(gamerange_bonus); gd.store(gamerange_bonus);