rem: var template =  getEntityTemplate(evt.name); 
add: var template =  getEntityTemplate( evt.name, this.player ); 
context: function entityFinishProduction( evt ){	console.write("FinishProduction: " + evt.productionType + " " + evt.name);		if(evt.productionType == PRODUCTION_TRAIN) 	{		var template =  getEntityTemplate(evt.name);			// Code to find a free space around an object is tedious and slow, so 		// I wrote it in C. Takes the template object so it can determine how		// much space it needs to leave.		var position = this.getSpawnPoint( template );				// The above function returns null if it couldn't find a large enough space.		if( !position )		{			console.write( "Couldn't train unit - not enough space" );			// Oh well. The player's just lost all the resources and time they put into			// construction - serves them right for not paying attention to the land			// around their barracks, doesn't it?		}		else		{			var created = new Entity( template, position );					// Above shouldn't ever fail, but just in case...			if( created )			{				console.write( "Created: ", template.tag );						// Entities start under Gaia control - make the controller				// the same as our controller				created.player = this.player;			}		}			}}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/bf615edbe75fd1937dad5e3f1c763f95636943bf/template_entity_script.js/clean/binaries/data/mods/official/entities/template_entity_script.js