remove unnnecessary location argument from unit::invalidate
This function was always called with the current location of the unit as the argument, so we simplify it.
This commit is contained in:
parent
654fd22ba8
commit
2282f6e90a
6 changed files with 9 additions and 9 deletions
|
@ -494,7 +494,7 @@ namespace { // Private helpers for move_unit()
|
|||
moves_left_.pop_front();
|
||||
|
||||
// Invalidate before moving so we invalidate neighbor hexes if needed.
|
||||
move_it_->invalidate(disp, *move_loc_);
|
||||
move_it_->invalidate(disp);
|
||||
|
||||
// Attempt actually moving.
|
||||
// (Fails if *step_to is occupied).
|
||||
|
|
|
@ -3067,7 +3067,7 @@ void display::invalidate_animations()
|
|||
#pragma omp parallel for reduction(|:new_inval) shared(unit_list) schedule(guided)
|
||||
#endif //_OPENMP
|
||||
for(int i=0; i < static_cast<int>(unit_list.size()); i++) {
|
||||
new_inval |= unit_list[i]->invalidate(*this,unit_list[i]->get_location());
|
||||
new_inval |= unit_list[i]->invalidate(*this);
|
||||
}
|
||||
}while(new_inval);
|
||||
}
|
||||
|
|
|
@ -945,7 +945,7 @@ WML_HANDLER_FUNCTION(kill, event_info, cfg)
|
|||
resources::screen->invalidate(loc);
|
||||
unit_map::iterator iun = resources::units->find(loc);
|
||||
if ( iun != resources::units->end() && iun.valid() )
|
||||
iun->invalidate(*resources::screen, loc);
|
||||
iun->invalidate(*resources::screen);
|
||||
}
|
||||
resources::screen->redraw_minimap();
|
||||
|
||||
|
|
|
@ -2159,7 +2159,7 @@ void unit::clear_haloes()
|
|||
}
|
||||
if(anim_ ) anim_->clear_haloes();
|
||||
}
|
||||
bool unit::invalidate(const display & disp, const map_location &loc)
|
||||
bool unit::invalidate(const display & disp)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
|
@ -2167,7 +2167,7 @@ bool unit::invalidate(const display & disp, const map_location &loc)
|
|||
if(get_animation()) {
|
||||
frame_parameters params;
|
||||
const gamemap & map = disp.get_map();
|
||||
const t_translation::t_terrain terrain = map.get_terrain(loc);
|
||||
const t_translation::t_terrain terrain = map.get_terrain(get_location());
|
||||
const terrain_type& terrain_info = map.get_terrain_info(terrain);
|
||||
|
||||
int height_adjust = static_cast<int>(terrain_info.unit_height_adjust() * disp.get_zoom_factor());
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
void set_facing(map_location::DIRECTION dir);
|
||||
map_location::DIRECTION facing() const { return facing_; }
|
||||
|
||||
bool invalidate(const display & disp, const map_location &loc);
|
||||
bool invalidate(const display & disp);
|
||||
const std::vector<t_string>& trait_names() const { return trait_names_; }
|
||||
const std::vector<t_string>& trait_descriptions() const { return trait_descriptions_; }
|
||||
std::vector<std::string> get_traits_list() const;
|
||||
|
|
|
@ -716,7 +716,7 @@ void manager::create_temp_move()
|
|||
}
|
||||
|
||||
unit_display::move_unit(path, *fake_unit, false); //get facing right
|
||||
fake_unit->invalidate(*game_display::get_singleton(), fake_unit->get_location());
|
||||
fake_unit->invalidate(*game_display::get_singleton());
|
||||
fake_unit->set_location(*curr_itor);
|
||||
fake_unit->set_ghosted(true);
|
||||
}
|
||||
|
@ -728,7 +728,7 @@ void manager::create_temp_move()
|
|||
}
|
||||
//in case path shortens on next step and one ghosted unit has to be removed
|
||||
int ind = fake_units_.size() - 1;
|
||||
fake_units_[ind]->invalidate(*game_display::get_singleton(),fake_units_[ind]->get_location());
|
||||
fake_units_[ind]->invalidate(*game_display::get_singleton());
|
||||
//toss out old arrows and fake units
|
||||
move_arrows_.resize(turn+1);
|
||||
fake_units_.resize(turn+1);
|
||||
|
@ -739,7 +739,7 @@ void manager::erase_temp_move()
|
|||
move_arrows_.clear();
|
||||
BOOST_FOREACH(fake_unit_ptr const& tmp, fake_units_) {
|
||||
if(tmp) {
|
||||
tmp->invalidate(*game_display::get_singleton(),tmp->get_location());
|
||||
tmp->invalidate(*game_display::get_singleton());
|
||||
}
|
||||
}
|
||||
fake_units_.clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue