From 307f9e8518f31c486f5cec9bccb3192975a5ba4c Mon Sep 17 00:00:00 2001 From: uid68803 Date: Mon, 12 Jan 2004 19:37:48 +0000 Subject: [PATCH] removed unnecessary diagnostics --- data/scenarios/Bay_of_Pearls.cfg | 2 +- data/scenarios/Ford_of_Abez.cfg | 2 +- src/actions.cpp | 4 +++- src/playlevel.cpp | 7 ++++++- src/theme.cpp | 3 ++- src/widgets/menu.cpp | 4 ---- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/data/scenarios/Bay_of_Pearls.cfg b/data/scenarios/Bay_of_Pearls.cfg index 9ebf3d30993..0c7e640d1c4 100644 --- a/data/scenarios/Bay_of_Pearls.cfg +++ b/data/scenarios/Bay_of_Pearls.cfg @@ -438,7 +438,7 @@ The main cage where they keep most of the mermen is in the south-east!" [/message] [/event] - {OBJ_TRIDENT_STORM 26 35} + {OBJ_TRIDENT_STORM 26 35 bop_stormtrident} [item] x=29 diff --git a/data/scenarios/Ford_of_Abez.cfg b/data/scenarios/Ford_of_Abez.cfg index 033da1a8a6b..e731481df9c 100644 --- a/data/scenarios/Ford_of_Abez.cfg +++ b/data/scenarios/Ford_of_Abez.cfg @@ -100,7 +100,7 @@ Defeat: [/target] [/side] - {OBJ_TRIDENT_STORM 16 17} + {OBJ_TRIDENT_STORM 16 17 ford_trident} #if the player dares attack Li'sar's escort, they are pounced on by #many Royal Guards diff --git a/src/actions.cpp b/src/actions.cpp index 5fd19ca822f..16c1e1f4a7e 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -902,8 +902,10 @@ void check_victory(std::map& units, std::vector seen_leaders; for(std::map::const_iterator i = units.begin(); i != units.end(); ++i) { - if(i->second.can_recruit()) + if(i->second.can_recruit()) { + std::cerr << "seen leader for side " << i->second.side() << "\n"; seen_leaders.push_back(i->second.side()); + } } //clear villages for teams that have no leader diff --git a/src/playlevel.cpp b/src/playlevel.cpp index f466206fc0b..e6f83a7d0a1 100644 --- a/src/playlevel.cpp +++ b/src/playlevel.cpp @@ -126,7 +126,10 @@ LEVEL_RESULT play_level(game_data& gameinfo, config& game_config, place_sides_in_preferred_locations(map,unit_cfg); } + std::cerr << "initializing teams..." << unit_cfg.size() << "\n";; + for(config::child_list::const_iterator ui = unit_cfg.begin(); ui != unit_cfg.end(); ++ui) { + std::cerr << "initializing team...\n"; if(first_human_team == -1 && (**ui)["controller"] == "human") { first_human_team = ui - unit_cfg.begin(); @@ -164,8 +167,10 @@ LEVEL_RESULT play_level(game_data& gameinfo, config& game_config, const std::string& has_loc = (**ui)["x"]; gamemap::location start_pos(**ui); - if(has_loc.empty()) + if(has_loc.empty()) { start_pos = map.starting_position(new_unit.side()); + std::cerr << "initializing side '" << (**ui)["side"] << "' at " << start_pos.x << "," << start_pos.y << "\n"; + } if(!start_pos.valid() && new_unit.side() == 1) { throw gamestatus::load_game_failed("No starting position for side 1"); diff --git a/src/theme.cpp b/src/theme.cpp index f3e32765b0b..10d7a7a101a 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -226,6 +226,7 @@ bool theme::set_resolution(const SDL_Rect& screen) for(i = resolutions.begin(); i != resolutions.end(); ++i) { const int width = atoi((**i)["width"].c_str()); const int height = atoi((**i)["height"].c_str()); + std::cerr << "comparing resolution " << screen.w << "," << screen.h << " to " << width << "," << height << "\n"; if(screen.w >= width && screen.h >= height) { std::cerr << "loading theme: " << width << "," << height << "\n"; current = i; @@ -240,7 +241,7 @@ bool theme::set_resolution(const SDL_Rect& screen) } } - if(current == resolutions.end()) { + if(!resolutions.empty() && current == resolutions.end()) { std::cerr << "ERROR: No valid resolution found\n"; return false; } diff --git a/src/widgets/menu.cpp b/src/widgets/menu.cpp index 59264560c9c..df05a553554 100644 --- a/src/widgets/menu.cpp +++ b/src/widgets/menu.cpp @@ -112,9 +112,7 @@ void menu::change_item(int pos1, int pos2,std::string str) size_t menu::max_items_onscreen() const { - std::cerr << "calculating max items on screen...\n"; if(max_items_ != -1) { - std::cerr << "cached: " << max_items_ << "\n"; return size_t(max_items_); } @@ -134,8 +132,6 @@ size_t menu::max_items_onscreen() const if(sum > max_height && n > 1) --n; - std::cerr << "returning max items: " << n << " (" << sum << ")\n"; - return max_items_ = n; }