widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #06281
Re: [Merge] lp:~widelands-dev/widelands/bug-1395278-logic1 into lp:widelands
Review: Approve compile / code read
See only harmless renamings here,
will play some games now, but this will take some time
Diff comments:
>
> === modified file 'src/logic/game.cc'
> --- src/logic/game.cc 2016-02-07 07:16:24 +0000
> +++ src/logic/game.cc 2016-02-16 14:25:27 +0000
> @@ -1024,40 +1024,40 @@
> // Read general statistics
> uint32_t entries = fr.unsigned_16();
> const PlayerNumber nr_players = map().get_nrplayers();
> - m_general_stats.resize(nr_players);
> + general_stats_.resize(nr_players);
>
> iterate_players_existing_novar(p, nr_players, *this) {
> - m_general_stats[p - 1].land_size .resize(entries);
> - m_general_stats[p - 1].nr_workers .resize(entries);
> - m_general_stats[p - 1].nr_buildings .resize(entries);
> - m_general_stats[p - 1].nr_wares .resize(entries);
> - m_general_stats[p - 1].productivity .resize(entries);
> - m_general_stats[p - 1].nr_casualties .resize(entries);
> - m_general_stats[p - 1].nr_kills .resize(entries);
> - m_general_stats[p - 1].nr_msites_lost .resize(entries);
> - m_general_stats[p - 1].nr_msites_defeated .resize(entries);
> - m_general_stats[p - 1].nr_civil_blds_lost .resize(entries);
> - m_general_stats[p - 1].nr_civil_blds_defeated.resize(entries);
> - m_general_stats[p - 1].miltary_strength.resize(entries);
> - m_general_stats[p - 1].custom_statistic.resize(entries);
> + general_stats_[p - 1].land_size .resize(entries);
> + general_stats_[p - 1].nr_workers .resize(entries);
> + general_stats_[p - 1].nr_buildings .resize(entries);
> + general_stats_[p - 1].nr_wares .resize(entries);
> + general_stats_[p - 1].productivity .resize(entries);
> + general_stats_[p - 1].nr_casualties .resize(entries);
> + general_stats_[p - 1].nr_kills .resize(entries);
> + general_stats_[p - 1].nr_msites_lost .resize(entries);
> + general_stats_[p - 1].nr_msites_defeated .resize(entries);
> + general_stats_[p - 1].nr_civil_blds_lost .resize(entries);
> + general_stats_[p - 1].nr_civil_blds_defeated.resize(entries);
> + general_stats_[p - 1].miltary_strength.resize(entries);
> + general_stats_[p - 1].custom_statistic.resize(entries);
We should try to kill such invariants, even if the compiler may find this ...
> }
>
> iterate_players_existing_novar(p, nr_players, *this)
> - for (uint32_t j = 0; j < m_general_stats[p - 1].land_size.size(); ++j)
> + for (uint32_t j = 0; j < general_stats_[p - 1].land_size.size(); ++j)
> {
> - m_general_stats[p - 1].land_size [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_workers [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_buildings [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_wares [j] = fr.unsigned_32();
> - m_general_stats[p - 1].productivity [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_casualties [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_kills [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_msites_lost [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_msites_defeated [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_civil_blds_lost [j] = fr.unsigned_32();
> - m_general_stats[p - 1].nr_civil_blds_defeated[j] = fr.unsigned_32();
> - m_general_stats[p - 1].miltary_strength[j] = fr.unsigned_32();
> - m_general_stats[p - 1].custom_statistic[j] = fr.unsigned_32();
> + general_stats_[p - 1].land_size [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_workers [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_buildings [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_wares [j] = fr.unsigned_32();
> + general_stats_[p - 1].productivity [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_casualties [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_kills [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_msites_lost [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_msites_defeated [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_civil_blds_lost [j] = fr.unsigned_32();
> + general_stats_[p - 1].nr_civil_blds_defeated[j] = fr.unsigned_32();
> + general_stats_[p - 1].miltary_strength[j] = fr.unsigned_32();
> + general_stats_[p - 1].custom_statistic[j] = fr.unsigned_32();
> }
> }
>
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1395278-logic1/+merge/286178
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1395278-logic1.
References