Changeset - r20671:08cd60b72911
[Not reviewed]
master
0 1 0
fonsinchen - 11 years ago 2013-08-10 12:47:13
fonsinchen@openttd.org
(svn r25709) -Fix: don't return -1 as unsigned
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_town.cpp
Show inline comments
 
@@ -117,14 +117,14 @@
 

	
 
	return ScriptObject::DoCommand(::Town::Get(town_id)->xy, town_id | (towneffect_id << 16), goal, CMD_TOWN_CARGO_GOAL);
 
}
 

	
 
/* static */ uint32 ScriptTown::GetCargoGoal(TownID town_id, ScriptCargo::TownEffect towneffect_id)
 
{
 
	if (!IsValidTown(town_id)) return -1;
 
	if (!ScriptCargo::IsValidTownEffect(towneffect_id)) return -1;
 
	if (!IsValidTown(town_id)) return UINT32_MAX;
 
	if (!ScriptCargo::IsValidTownEffect(towneffect_id)) return UINT32_MAX;
 

	
 
	const Town *t = ::Town::Get(town_id);
 

	
 
	switch (t->goal[towneffect_id]) {
 
		case TOWN_GROWTH_WINTER:
 
			if (TileHeight(t->xy) >= GetSnowLine() && t->cache.population > 90) return 1;
0 comments (0 inline, 0 general)