From 7c2aa1d466006c5cb1f63b843473a491f258c604 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:02:50 -0500 Subject: [PATCH] Guard access to creature moves (make protected variable) --- src/creature.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/creature.h b/src/creature.h index 866f9b8942cca..a32c746ac98be 100644 --- a/src/creature.h +++ b/src/creature.h @@ -944,7 +944,6 @@ class Creature : public viewer /** Returns a set of points we do not want to path through. */ virtual std::unordered_set get_path_avoid() const = 0; - int moves; bool underwater; void draw( const catacurses::window &w, const point &origin, bool inverted ) const; void draw( const catacurses::window &w, const tripoint &origin, bool inverted ) const; @@ -1193,6 +1192,8 @@ class Creature : public viewer // handles removing the creature if the timer runs out void decrement_summon_timer(); protected: + // How many moves do we have to work with + int moves; Creature *killer; // whoever killed us. this should be NULL unless we are dead void set_killer( Creature *killer ); std::optional lifespan_end = std::nullopt;