rem: cmd = NMT_AddWaypoint; 
add: if (!selection[i].actions) continue; console.write("Requesting notification for " + event.entity); selection[i].requestNotification( event.entity, action, true, false ); selection[i].order( ORDER_GOTO, event.entity.position.x, event.entity.position.z -							selection[i].actions.escort.distance, true); 
context: function worldClickHandler(event){	args=new Array(null, null);	console.write("worldClickHandler: button "+event.button+", clicks "+event.clicks);	if (isSelecting())	{		getGlobal().selectionWorldClickHandler(event);		return;	}	// Right button single- or double-clicks	if (event.button == SDL_BUTTON_RIGHT && event.clicks <= 2)	{		if (event.clicks == 1)			cmd = event.order;		else if (event.clicks == 2)		{			console.write("Issuing secondary order");			cmd = event.secondaryOrder;		}	}	else	{		return;	}	//setting rally point	if ( getCursorName() == "cursor-rally" )	{			for ( var i=0; i<selection.length; i++ )			selection[i].setRallyPoint();			setCursor("arrow-default");		return;	}	switch (cmd)	{		// location target commands		case NMT_Goto:		case NMT_Run:		case NMT_Patrol:			if (event.queued)			{				cmd = NMT_AddWaypoint;			}			args[0]=event.x;			args[1]=event.y;		break;		case NMT_AddWaypoint:			args[0]=event.x;			args[1]=event.y;		break;		// entity target commands		// I'm guessing we no longer require these now that they have become generic events?//		case NMT_AttackMelee://		case NMT_Gather://		case NMT_Heal://			args[0]=event.entity;//			args[1]=null;//		break;		case NMT_Generic:			args[0]=event.entity;			if ( event.clicks == 1)				args[1]=event.action;			else				args[1]=event.secondaryAction;		break;		//TODO:  get rid of order() calls.		case NMT_NotifyRequest:			if (event.clicks == 1)				action = event.action;			else				action = event.secondaryAction;						if (event.entity.isIdle())			{				for (var i=0; i<selection.length;i++)							{					if (!selection[i].actions)						continue;					console.write("Requesting notification for " + event.entity);					selection[i].requestNotification( event.entity, action, true, false );					selection[i].order( ORDER_GOTO, event.entity.position.x, event.entity.position.z -							selection[i].actions.escort.distance, true);				}			}			else			{				for (var i=0; i<selection.length;i++)					{					if (!selection[i].actions)						continue;					console.write("Requesting notification for " + event.entity);							selection[i].requestNotification( event.entity, action, true, false );				}			}							return;		default:			console.write("worldClickHandler: Unknown order: "+cmd);			return;	}		if (event.clicks == 2)		triggerSelectionRun();	else		setSelectionRun();	issueCommand (selection, isOrderQueued(), cmd, args[0], args[1]);}
meta: 1070	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1070/43323342db248d6227b69129e134b6eea35acbfa/functions_sim_entity.js/buggy/binaries/data/mods/official/gui/test/functions_sim_entity.js