made it so you can't see the gold of enemies

This commit is contained in:
Dave White 2003-10-26 03:09:47 +00:00
parent 4e6e1f3cc1
commit 2ba23d1965
2 changed files with 19 additions and 4 deletions

View file

@ -1001,10 +1001,22 @@ bool turn_slice(game_data& gameinfo, game_state& state_of_game,
for(size_t n = 0; n != teams.size(); ++n) {
const team_data data = calculate_team_data(teams[n],n+1,units);
const bool on_side = n+1 == size_t(team_num) ||
!current_team.is_enemy(n+1);
std::stringstream str;
str << team_name(n+1,units) << ","
<< (data.gold < 0 ? "#":"") << data.gold << ","
<< data.villages << ","
if(!on_side)
str << "#";
str << team_name(n+1,units) << ",";
//only show gold for player's team and allies
if(on_side)
str << (data.gold < 0 ? "#":"") << data.gold << ",";
else
str << "?,";
str << data.villages << ","
<< data.units << ","
<< data.upkeep << ","
<< (data.net_income < 0 ? "#":"") << data.net_income;

View file

@ -513,7 +513,10 @@ void show_video_mode_dialog(display& disp)
CVideo& video = disp.video();
SDL_Rect** modes = SDL_ListModes(video.getSurface()->format,FULL_SCREEN);
if(reinterpret_cast<int>(modes) == -1 || modes == NULL) {
//the SDL documentation says that a return value of -1 if no dimension
//is available.
if(modes == reinterpret_cast<SDL_Rect**>(-1) || modes == NULL) {
if(modes != NULL)
std::cerr << "Can support any video mode\n";
else