Esempio n. 1
0
/* static */ COrder *COrder::NewActionResearch(CUnit &unit, CUpgrade &upgrade)
{
	COrder_Research *order = new COrder_Research();

	// FIXME: if you give quick an other order, the resources are lost!
	unit.Player->SubCosts(upgrade.Costs);

	order->SetUpgrade(upgrade);
	return order;
}
Esempio n. 2
0
//Wyrmgus start
///* static */ COrder *COrder::NewActionResearch(CUnit &unit, CUpgrade &upgrade)
/* static */ COrder *COrder::NewActionResearch(CUnit &unit, CUpgrade &upgrade, int player)
//Wyrmgus end
{
	COrder_Research *order = new COrder_Research();

	// FIXME: if you give quick an other order, the resources are lost!
	//Wyrmgus start
	order->Player = player;
//	unit.Player->SubCosts(upgrade.Costs);
	int upgrade_costs[MaxCosts];
	Players[player].GetUpgradeCosts(&upgrade, upgrade_costs);
	Players[player].SubCosts(upgrade_costs);
	//Wyrmgus end

	order->SetUpgrade(upgrade);
	return order;
}