← Back to team overview

widelands-dev team mailing list archive

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

 

Diff.

Diff comments:

> 
> === modified file 'src/scripting/lua_map.cc'
> --- src/scripting/lua_map.cc	2016-04-11 06:45:29 +0000
> +++ src/scripting/lua_map.cc	2016-04-17 06:41:21 +0000
> @@ -1871,10 +1871,16 @@
>  /* RST
>  	.. attribute:: workarea_radius
>  
> -			(RO) the workarea_radius of the building as an int.
> +			(RO) the first workarea_radius of the building as an int,
> +                  nil in case bulding has no workareas
>  */
>  int LuaBuildingDescription::get_workarea_radius(lua_State * L) {
> -	lua_pushinteger(L, get()->workarea_info_.begin()->first);
> +    const WorkareaInfo& workareaInfo = get()->workarea_info_;

You missed this space indent here.

> +	if (!workareaInfo.empty()) {
> +		lua_pushinteger(L, workareaInfo.begin()->first);
> +	} else {
> +		lua_pushnil(L);
> +	}
>  	return 1;
>  }
>  


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


References