From 8770caaa00932e861524d1452609c2a1e608c4e6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 17 Sep 2024 17:57:38 +0200 Subject: [PATCH] ads:: clear displayed to prevent crashes --- rogueviz/ads/ads-game.cpp | 2 ++ rogueviz/ads/ds-game.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/rogueviz/ads/ads-game.cpp b/rogueviz/ads/ads-game.cpp index 8e42ed7d..43846ac7 100644 --- a/rogueviz/ads/ads-game.cpp +++ b/rogueviz/ads/ads-game.cpp @@ -82,6 +82,7 @@ void restart() { }); ci_at.clear(); + displayed.clear(); gen_terrain(vctr, ci_at[vctr], -2); forCellEx(c1, vctr) ci_at[c1].type = wtNone; @@ -137,6 +138,7 @@ void run_ads_game() { void add_ads_cleanup() { rogueviz::on_cleanup_or_next([] { switch_spacetime_to(true); + displayed.clear(); }); } diff --git a/rogueviz/ads/ds-game.cpp b/rogueviz/ads/ds-game.cpp index 66a5c047..60819c7b 100644 --- a/rogueviz/ads/ds-game.cpp +++ b/rogueviz/ads/ds-game.cpp @@ -708,6 +708,7 @@ void ds_restart() { rocks.clear(); history.clear(); + displayed.clear(); init_ds_game(); reset_textures(); pick_textures(); @@ -739,6 +740,7 @@ void run_ds_game() { void add_ds_cleanup() { rogueviz::on_cleanup_or_next([] { main_rock = nullptr; + displayed.clear(); }); }