Skip to content

Commit

Permalink
Guard access to creature moves (make protected variable)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Mar 9, 2024
1 parent b4c665a commit 7c2aa1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,6 @@ class Creature : public viewer
/** Returns a set of points we do not want to path through. */
virtual std::unordered_set<tripoint> 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;
Expand Down Expand Up @@ -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<time_point> lifespan_end = std::nullopt;
Expand Down

0 comments on commit 7c2aa1d

Please sign in to comment.