Skip to content

Commit

Permalink
Update size class when size changes
Browse files Browse the repository at this point in the history
  • Loading branch information
harakka committed Oct 30, 2024
1 parent f56aaa2 commit c3723ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ Character::Character() :
name.clear();
custom_profession.clear();

*path_settings = pathfinding_settings{ 0, 1000, 1000, 0, true, true, true, true, false, true, creature_size::medium };
*path_settings = pathfinding_settings{ 0, 1000, 1000, 0, true, true, true, true, false, true, get_size() };

Check failure on line 594 in src/character.cpp

View workflow job for this annotation

GitHub Actions / build (src)

Call to virtual method 'Character::get_size' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall,-warnings-as-errors]

move_mode = move_mode_walk;
next_expected_position = std::nullopt;
Expand Down
3 changes: 2 additions & 1 deletion src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5481,8 +5481,9 @@ std::pair<item *, tripoint_bub_ms> map::_add_item_or_charges( const tripoint_bub
std::vector<tripoint_bub_ms> tiles = closest_points_first( pos, max_dist );
tiles.erase( tiles.begin() ); // we already tried this position
const int max_path_length = 4 * max_dist;
// TODO need to make creature size nullable so it can be ignored when not pathing for creature
const pathfinding_settings setting( 0, max_dist, max_path_length, 0, false, false, true, false,
false, false, creature_size::medium );
false, false, creature_size::huge );
for( const tripoint_bub_ms &e : tiles ) {
if( copies_remaining <= 0 ) {
break;
Expand Down
2 changes: 2 additions & 0 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "options.h"
#include "output.h"
#include "overmapbuffer.h"
#include "pathfinding.h"
#include "pimpl.h"
#include "player_activity.h"
#include "rng.h"
Expand Down Expand Up @@ -555,6 +556,7 @@ void Character::recalculate_size()
size_class = creature_size::medium;
}
}
path_settings->creature_size = size_class;
}

void Character::mutation_effect( const trait_id &mut, const bool worn_destroyed_override )
Expand Down

0 comments on commit c3723ed

Please sign in to comment.