← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/elk_moose into lp:widelands

 

Some questions inline Code otherwise LGTM.
Will commpile this and the read that code again.

Diff comments:

> 
> === modified file 'src/logic/map.cc'
> --- src/logic/map.cc	2019-05-16 09:15:03 +0000
> +++ src/logic/map.cc	2019-06-22 11:22:28 +0000
> @@ -714,6 +714,22 @@
>  	pathfieldmgr_->set_size(field_size);
>  }
>  
> +int Map::needs_widelands_version_after() const {
> +	return map_version_.needs_widelands_version_after;
> +}
> +
> +void Map::calculate_needs_widelands_version_after(bool is_post_one_world) {

* Please add a acommnt what this "is_post_one_world" means

> +	if (map_version_.needs_widelands_version_after == 0) {
> +		if (nrplayers_ > 8) {
> +			// We introduced support for 16 players after Build 19
> +			map_version_.needs_widelands_version_after = 19;
> +		} else if (is_post_one_world) {
> +			// We merged the worlds in the engine after Build 18
> +			map_version_.needs_widelands_version_after = 18;
> +		}
> +	}
> +}
> +
>  /*
>   * The scenario get/set functions
>   */
> 
> === modified file 'src/map_io/map_version_packet.cc'
> --- src/map_io/map_version_packet.cc	2019-02-23 11:00:49 +0000
> +++ src/map_io/map_version_packet.cc	2019-06-22 11:22:28 +0000
> @@ -30,11 +30,17 @@
>  namespace Widelands {
>  
>  constexpr uint16_t kCurrentPacketVersion = 1;
> +// Map compatibility information for the website
> +constexpr int kCurrentNeedsWidelandsVersionAfter = 20;

Mhh, when do we have to increase that number? When we get the ferries?

>  
>  void MapVersionPacket::read(FileSystem& fs,
>                              EditorGameBase& egbase,
> -                            bool const skip,
> -                            MapObjectLoader&) {
> +                            bool const skip, bool is_post_one_world) {
> +
> +	pre_read(fs, egbase.mutable_map(), skip, is_post_one_world);
> +}
> +
> +void MapVersionPacket::pre_read(FileSystem& fs, Map* map, bool skip, bool is_post_one_world) {
>  	if (skip)
>  		return;
>  


-- 
https://code.launchpad.net/~widelands-dev/widelands/elk_moose/+merge/369201
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/elk_moose into lp:widelands.


References