petra: fix buildLimit when it is 0, reported by fatherbushido

This was SVN commit r18185.
This commit is contained in:
mimo 2016-05-16 10:23:35 +00:00
parent f4e69b7c07
commit 7ddfc89c18

View file

@ -1805,7 +1805,7 @@ m.HQ.prototype.canBuild = function(gameState, structure)
// build limits
var limits = gameState.getEntityLimits();
var category = template.buildCategory();
if (category && limits[category] && gameState.getEntityCounts()[category] >= limits[category])
if (category && limits[category] !== undefined && gameState.getEntityCounts()[category] >= limits[category])
return false;
return true;