fixed crash when changing fonts.
made general more powerful
This commit is contained in:
parent
f8f16b0cb3
commit
8ac2ca8ed9
7 changed files with 22 additions and 20 deletions
|
@ -478,7 +478,6 @@ race="Race"
|
|||
team="Team"
|
||||
color="Color"
|
||||
error_no_mp_sides="No multiplayer sides."
|
||||
error_not_part_of_game="Your not part of this save game."
|
||||
|
||||
#Races
|
||||
elves="Elves"
|
||||
|
|
|
@ -20,7 +20,7 @@ get_hit_sound=groan.wav
|
|||
type=blade
|
||||
range=short
|
||||
damage=8
|
||||
number=3
|
||||
number=4
|
||||
[sound]
|
||||
time=-250
|
||||
sound=sword-swish.wav
|
||||
|
|
|
@ -87,10 +87,11 @@ TTF_Font* get_font(int size)
|
|||
|
||||
void clear_fonts()
|
||||
{
|
||||
for(std::map<int,TTF_Font*>::iterator i = font_table.begin();
|
||||
i != font_table.end(); ++i) {
|
||||
for(std::map<int,TTF_Font*>::iterator i = font_table.begin(); i != font_table.end(); ++i) {
|
||||
TTF_CloseFont(i->second);
|
||||
}
|
||||
|
||||
font_table.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -179,21 +179,6 @@ int mp_connect::load_map(int map, int num_turns, int village_gold,
|
|||
}
|
||||
|
||||
config::child_iterator sd;
|
||||
if(save_ == true) {
|
||||
bool found = false;
|
||||
for(sd = sides.first; sd != sides.second; ++sd) {
|
||||
if ((**sd)["description"] == preferences::login())
|
||||
found = true;
|
||||
}
|
||||
if (found == false) {
|
||||
gui::show_dialog(*disp_, NULL, "",
|
||||
string_table["error_not_part_of_game"],
|
||||
gui::OK_ONLY);
|
||||
status_ = -1;
|
||||
return status_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool first = true;
|
||||
for(sd = sides.first; sd != sides.second; ++sd) {
|
||||
|
|
|
@ -795,7 +795,7 @@ bool turn_info::can_execute_command(hotkey::HOTKEY_COMMAND command) const
|
|||
return true;
|
||||
|
||||
case hotkey::HOTKEY_SPEAK:
|
||||
return network::nconnections() > 0;
|
||||
return network::nconnections() > 0 && !is_observer();
|
||||
|
||||
case hotkey::HOTKEY_REDO:
|
||||
return !browse_ && !redo_stack_.empty();
|
||||
|
|
15
src/team.cpp
15
src/team.cpp
|
@ -557,4 +557,19 @@ const std::set<gamemap::location> vacant_towers(const std::set<gamemap::location
|
|||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool is_observer()
|
||||
{
|
||||
if(teams == NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(std::vector<team>::const_iterator i = teams->begin(); i != teams->end(); ++i) {
|
||||
if(i->is_human()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
|
@ -135,4 +135,6 @@ struct teams_manager {
|
|||
~teams_manager();
|
||||
};
|
||||
|
||||
bool is_observer();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue