rem: var result = entityCheckQueueReq( this, template ); 
add: var result = checkEntityReqs( this.player, template ); 
context: function entityStartProduction( evt ){	console.write("StartProduction: " + evt.productionType + " " + evt.name);		if(evt.productionType == PRODUCTION_TRAIN) 	{		var template = getEntityTemplate( evt.name, this.player );		var result = entityCheckQueueReq( this, template );			if (result == true) // If the entry meets requirements to be added to the queue (eg sufficient resources) 		{			// Cycle through all costs of this entry.			var pool = template.traits.creation.resource;			for ( resource in pool )			{				switch ( getGUIGlobal().toTitleCase(resource.toString()) )				{					case "Population":					case "Housing":					break;					default:						// Deduct the given quantity of resources.						getGUIGlobal().deductResources (resource.toString(), parseInt(pool[resource]));						console.write ("Spent " + pool[resource] + " " + resource + " to purchase " + 							template.traits.id.generic);					break;				}			}				// Set the amount of time it will take to complete production of the production object.			evt.time = getEntityTemplate( evt.name, this.player ).traits.creation.time;		}		else		{				// If not, output the error message.			console.write(result);			evt.preventDefault();		}	}	else	{		evt.preventDefault();	}}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/7dd219756b44102fbab2e7cc9ffbd5a04a4422b3/entity_functions.js/buggy/binaries/data/mods/official/scripts/entity_functions.js