Skip to content

Commit

Permalink
Back out "Move remove_creature_from_reachability calls from the destr…
Browse files Browse the repository at this point in the history
…uctor to on_unload. The avatar never unloads. (CleverRaven#69368)"

Original commit changeset: e8f77ab
  • Loading branch information
akrieger committed Nov 15, 2023
1 parent d586ccb commit 7bc616e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ Creature::Creature( Creature && ) noexcept( map_is_noexcept &&list_is_noexcept )
Creature &Creature::operator=( const Creature & ) = default;
Creature &Creature::operator=( Creature && ) noexcept = default;

Creature::~Creature() = default;
Creature::~Creature()
{
if( g ) {
get_map().remove_creature_from_reachability( this );
}
}

tripoint Creature::pos() const
{
Expand Down
1 change: 0 additions & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3703,7 +3703,6 @@ bool monster::will_join_horde( int size )
void monster::on_unload()
{
last_updated = calendar::turn;
get_map().remove_creature_from_reachability( this );
}

void monster::on_load()
Expand Down
1 change: 0 additions & 1 deletion src/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,6 @@ void npc::add_new_mission( class mission *miss )

void npc::on_unload()
{
get_map().remove_creature_from_reachability( this );
}

// A throtled version of player::update_body since npc's don't need to-the-turn updates.
Expand Down

0 comments on commit 7bc616e

Please sign in to comment.