← Back to team overview

widelands-dev team mailing list archive

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

 

Review: Needs Fixing

But I dont think it is correct, providing that m_items is bigger then 1 and it contains various wares - count should be either sum of all item_pair.second (see comment of diff) or rather the result string should be in format  warename+count and should be generated differently... In fact I dont remember detaily the format of this string in the game...

Diff comments:

> === modified file 'src/logic/production_program.cc'
> --- src/logic/production_program.cc	2015-11-28 13:56:45 +0000
> +++ src/logic/production_program.cc	2015-11-28 21:50:45 +0000
> @@ -1049,7 +1049,7 @@
>  	assert(m_items.size());
>  
>  	std::vector<std::string> ware_descnames;
> -	uint8_t count;
> +	uint8_t count = 0;
>  	for (const auto& item_pair : m_items) {
>  		count = item_pair.second;

One solution:
count += item_pair.second;

>  		std::string ware_descname = tribe.get_ware_descr(item_pair.first)->descname();


-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1520820/+merge/278898
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520820.


References