rem: if (resources[resource] > (localPlayer.resource["HOUSING"]-localPlayer.resource[resourceU])) 
add: if (template.traits.population.rem > (localPlayer.resource["HOUSING"]-localPlayer.resource[resourceU])) 
context: function entityCheckQueueReq( entity, template ) { 	// Determines if the given entity meets requirements for production by the player, and returns an appropriate 	// error string.	// A return value of 0 equals success -- entry meets requirements for production. 		// Cycle through all resources that this item costs, and check the player can afford the cost.	resources = template.traits.creation.resource;	for( resource in resources )	{		resourceU = resource.toString().toUpperCase();				switch( resourceU )		{			case "POPULATION":				// If the item costs more of this resource type than we have,				if (resources[resource] > (localPlayer.resource["HOUSING"]-localPlayer.resource[resourceU]))				{					// Return an error.					return ("Insufficient Housing; " + (resources[resource]-localPlayer.resource["HOUSING"]-localPlayer.resource.valueOf()[resourceU].toString()) + " required."); 				}			break;			case "HOUSING": // Ignore housing. It's handled in combination with population.			break			default:				// If the item costs more of this resource type than we have,				if (resources[resource] > localPlayer.resource[resourceU])				{					// Return an error.					return ("Insufficient " + resource + "; " + (localPlayer.resource[resourceU]-resources[resource])*-1 + " required."); 				}				else					console.write("Player has at least " + resources[resource] + " " + resource + ".");			break;		}	}	// Check if another entity must first exist. 	// Check if another tech must first be researched. 	// Check if the limit for this type of entity has been reached. 	// If we passed all checks, return success. Entity can be queued.	return "true"; }
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/795e07990e4fc2e5f2e5b31da6555bb14672f821/template_entity_script.js/buggy/binaries/data/mods/official/entities/template_entity_script.js