rem: getGUIGlobal().giveResources( r.toString(), amount ); 
add: this.player.resources[r.toString()] += amount; 
context: function foundationDestroyed( evt ){	if( this.building != "" )	// Check that we're *really* a foundation since the event handler is kept when we change templates (probably a bug)	{		//console.write( "Hari Seldon made a small calculation error." );				var bp = this.build_points;		var fractionToReturn = (bp.max - bp.curr) / bp.max;				var resources = getEntityTemplate( this.building, this.player ).traits.creation.resource;		for( r in resources )		{			amount = parseInt( fractionToReturn * parseInt(resources[r]) );			getGUIGlobal().giveResources( r.toString(), amount );		}	}}
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