1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 04:37:10 +00:00

arcm:: fixed the possible crash on deleting arcms with large cells, because of the confusion of cdata

This commit is contained in:
Zeno Rogue
2021-07-04 11:00:38 +02:00
parent f873a4ba18
commit e37fa65247
4 changed files with 6 additions and 14 deletions

View File

@@ -378,9 +378,9 @@ EX void clearfrom(heptagon *at) {
q.pop();
DEBB(DF_MEMORY, ("from %p", at));
if(!at->c7) {
heptagon *h = (heptagon*) at->cdata;
heptagon *h = dynamic_cast<heptagon*> ((cdata_or_heptagon*) at->cdata);
if(h) {
if(h->alt != at) { DEBB(DF_MEMORY | DF_ERROR, ("alt error :: h->alt = ", h->alt)); }
if(h->alt != at) { DEBB(DF_MEMORY | DF_ERROR, ("alt error :: h->alt = ", h->alt, " expected ", at)); }
cell *c = h->c7;
subcell(c, destroycellcontents);
h->alt = NULL;