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:
parent
7deb98154f
commit
b87f051b3f
@ -36,6 +36,18 @@ struct gamedata {
|
||||
}
|
||||
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
|
||||
|
||||
@ -49,7 +61,7 @@ void gamedata_all(gamedata& gd) {
|
||||
gd.store(chaosmode);
|
||||
gd.store(*current_display);
|
||||
gd.store(cgip);
|
||||
gd.store(vid);
|
||||
gd.store_ptr(vid);
|
||||
gd.store(sightrange_bonus);
|
||||
gd.store(genrange_bonus);
|
||||
gd.store(gamerange_bonus);
|
||||
|
Loading…
Reference in New Issue
Block a user