minor changes

This commit is contained in:
Dave White 2003-10-15 09:11:21 +00:00
parent aa5ebf2bfe
commit 14501c1aaa
5 changed files with 35 additions and 9 deletions

View File

@ -2,9 +2,9 @@ gggggggggggggggg
gggggggggggggggg
fffffggggggggggg
fffffggggggggggg
fffffggggggggggg
fffffggggggggggg
fffffggggggggggg
fffffggggSSSSggg
fffffggggSSSSggg
fffffgggggSSSggg
fffffggggggggggg
fffffCCggggggggg
ggC1CC2ggggggggg

View File

@ -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]

View File

@ -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

View File

@ -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(&current_paths);
enemy_paths = true;
//restore unit's movement
u->second.set_movement(movement);
}
}

View File

@ -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;