From 18d33e85894f1eb2d1838aa1dd3a93baac8ea4b9 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Wed, 9 Apr 2025 00:30:28 -0400 Subject: [PATCH] Fix not clearing checkpoint list between maps --- src/mobj_list.hpp | 8 ++++++++ src/objects/checkpoint.cpp | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mobj_list.hpp b/src/mobj_list.hpp index 4a3150207..af394e08a 100644 --- a/src/mobj_list.hpp +++ b/src/mobj_list.hpp @@ -77,6 +77,14 @@ struct MobjList } } + void clear() + { + while (!empty()) + { + erase(front()); + } + } + auto begin() const { return view().begin(); } auto end() const { return view().end(); } diff --git a/src/objects/checkpoint.cpp b/src/objects/checkpoint.cpp index 8ceba4df4..6060e89e7 100644 --- a/src/objects/checkpoint.cpp +++ b/src/objects/checkpoint.cpp @@ -502,7 +502,11 @@ struct CheckpointManager chk->gingerbread(); } - void clear() { lines_.clear(); } + void clear() + { + lines_.clear(); + list_.clear(); + } auto count() { return list_.count(); } @@ -558,7 +562,7 @@ void Obj_CheckpointThink(mobj_t* end) chk->animate(); } -void __attribute__((optimize("O0"))) Obj_CrossCheckpoints(player_t* player, fixed_t old_x, fixed_t old_y) +void Obj_CrossCheckpoints(player_t* player, fixed_t old_x, fixed_t old_y) { LineOnDemand ray(old_x, old_y, player->mo->x, player->mo->y, player->mo->radius);