mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 15:00:26 +00:00
ray:: fixed crashes when rmap is destroyed while in use
This commit is contained in:
parent
c6beebec79
commit
891f163954
@ -1676,9 +1676,11 @@ struct raycast_map {
|
|||||||
};
|
};
|
||||||
|
|
||||||
unique_ptr<raycast_map> rmap;
|
unique_ptr<raycast_map> rmap;
|
||||||
|
bool reset_rmap = false;
|
||||||
|
|
||||||
EX void reset_raycaster() {
|
EX void reset_raycaster() {
|
||||||
our_raycaster = nullptr; rmap = nullptr;
|
our_raycaster = nullptr;
|
||||||
|
reset_rmap = true;
|
||||||
rots::saved_matrices_ray = {};
|
rots::saved_matrices_ray = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1851,6 +1853,8 @@ EX void cast() {
|
|||||||
if(o->uFogColor != -1)
|
if(o->uFogColor != -1)
|
||||||
glUniform4f(o->uFogColor, cols[0], cols[1], cols[2], cols[3]);
|
glUniform4f(o->uFogColor, cols[0], cols[1], cols[2], cols[3]);
|
||||||
|
|
||||||
|
if(reset_rmap) rmap = nullptr, reset_rmap = false;
|
||||||
|
|
||||||
if(!rmap) rmap = (unique_ptr<raycast_map>) new raycast_map;
|
if(!rmap) rmap = (unique_ptr<raycast_map>) new raycast_map;
|
||||||
|
|
||||||
if(rmap->need_to_create(cs)) {
|
if(rmap->need_to_create(cs)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user