File diff r2497:4f8fde59a2e8 → r2498:8dfa040ed505
economy.c
Show inline comments
 
@@ -1320,13 +1320,13 @@ int LoadUnloadVehicle(Vehicle *v)
 
	int result = 0;
 
	uint16 last_visited;
 
	Station *st;
 
	GoodsEntry *ge;
 
	int t;
 
	uint count, cap;
 
	byte old_player;
 
	PlayerID old_player;
 
	bool completely_empty = true;
 

	
 
	assert(v->current_order.type == OT_LOADING);
 

	
 
	v->cur_speed = 0;
 

	
 
@@ -1557,14 +1557,14 @@ int32 CmdBuyShareInCompany(int x, int y,
 

	
 
	/* We can not buy out a real player (temporarily). TODO: well, enable it obviously */
 
	if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 1 && !p->is_ai) return 0;
 

	
 
	cost = CalculateCompanyValue(p) >> 2;
 
	if (flags & DC_EXEC) {
 
		PlayerID* b = p->share_owners;
 
		int i;
 
		byte *b = p->share_owners;
 

	
 
		while (*b != OWNER_SPECTATOR) b++; /* share owners is guaranteed to contain at least one OWNER_SPECTATOR */
 
		*b = _current_player;
 

	
 
		for (i = 0; p->share_owners[i] == _current_player;) {
 
			if (++i == 4) {
 
@@ -1599,13 +1599,13 @@ int32 CmdSellShareInCompany(int x, int y
 

	
 
	/* adjust it a little to make it less profitable to sell and buy */
 
	cost = CalculateCompanyValue(p) >> 2;
 
	cost = -(cost - (cost >> 7));
 

	
 
	if (flags & DC_EXEC) {
 
		byte *b = p->share_owners;
 
		PlayerID* b = p->share_owners;
 
		while (*b != _current_player) b++; /* share owners is guaranteed to contain player */
 
		*b = OWNER_SPECTATOR;
 
		InvalidateWindow(WC_COMPANY, (int)p1);
 
	}
 
	return cost;
 
}