mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 16:21:40 +00:00
minor changes
This commit is contained in:
parent
aa5ebf2bfe
commit
14501c1aaa
@ -2,9 +2,9 @@ gggggggggggggggg
|
||||
gggggggggggggggg
|
||||
fffffggggggggggg
|
||||
fffffggggggggggg
|
||||
fffffggggggggggg
|
||||
fffffggggggggggg
|
||||
fffffggggggggggg
|
||||
fffffggggSSSSggg
|
||||
fffffggggSSSSggg
|
||||
fffffgggggSSSggg
|
||||
fffffggggggggggg
|
||||
fffffCCggggggggg
|
||||
ggC1CC2ggggggggg
|
||||
|
@ -17,7 +17,7 @@
|
||||
canrecruit=1
|
||||
controller=human
|
||||
hitpoints=10
|
||||
recruit=Elvish Hero,Elvish Fighter,Elvish Archer,Horseman,Mage,Elvish Shaman
|
||||
recruit=Elvish Hero,Elvish Fighter,Elvish Archer,Horseman,Mage,Elvish Shaman,Red Mage
|
||||
enemy=2
|
||||
[/side]
|
||||
|
||||
|
@ -61,6 +61,15 @@ blue=200
|
||||
no_overlay=true
|
||||
[/terrain]
|
||||
|
||||
[terrain]
|
||||
image=snow
|
||||
name=tundra
|
||||
char=S
|
||||
red=255
|
||||
green=255
|
||||
blue=255
|
||||
[/terrain]
|
||||
|
||||
[terrain]
|
||||
image=hills
|
||||
name=hills
|
||||
|
@ -170,15 +170,12 @@ void play_turn(game_data& gameinfo, game_state& state_of_game,
|
||||
|
||||
//temporarily set moves to full to see how far
|
||||
//it could move
|
||||
const int movement = u->second.movement_left();
|
||||
u->second.set_movement(u->second.total_movement());
|
||||
const unit_movement_resetter move_change(u->second);
|
||||
|
||||
current_paths = paths(map,gameinfo,units,new_hex,teams,
|
||||
ignore_zocs,teleport);
|
||||
gui.set_paths(¤t_paths);
|
||||
enemy_paths = true;
|
||||
|
||||
//restore unit's movement
|
||||
u->second.set_movement(movement);
|
||||
}
|
||||
}
|
||||
|
||||
|
20
src/unit.hpp
20
src/unit.hpp
@ -24,6 +24,8 @@
|
||||
class unit
|
||||
{
|
||||
public:
|
||||
friend struct unit_movement_resetter;
|
||||
|
||||
unit(game_data& data, const config& cfg);
|
||||
unit(const unit_type* t, int side, bool use_traits=false);
|
||||
|
||||
@ -145,6 +147,24 @@ private:
|
||||
void apply_modifications();
|
||||
};
|
||||
|
||||
//object which temporarily resets a unit's movement
|
||||
struct unit_movement_resetter
|
||||
{
|
||||
unit_movement_resetter(unit& u) : u_(u), moves_(u.moves_)
|
||||
{
|
||||
u.moves_ = u.total_movement();
|
||||
}
|
||||
|
||||
~unit_movement_resetter()
|
||||
{
|
||||
u_.moves_ = moves_;
|
||||
}
|
||||
|
||||
private:
|
||||
unit& u_;
|
||||
int moves_;
|
||||
};
|
||||
|
||||
struct compare_unit_values
|
||||
{
|
||||
bool operator()(const unit& a, const unit& b) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user