File diff r5586:c50e3258a19f → r5587:034e5e185dc2
src/misc_cmd.cpp
Show inline comments
 
@@ -37,13 +37,13 @@ int32 CmdSetPlayerFace(TileIndex tile, u
 
 * @param p2 new colour for vehicles, property, etc.
 
 */
 
int32 CmdSetPlayerColor(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 
{
 
	Player *p, *pp;
 
	byte colour;
 
	LiveryScheme scheme = GB(p1, 0, 8);
 
	LiveryScheme scheme = (LiveryScheme)GB(p1, 0, 8);
 
	byte state = GB(p1, 8, 2);
 

	
 
	if (p2 >= 16) return CMD_ERROR; // max 16 colours
 
	colour = p2;
 

	
 
	if (scheme >= LS_END || state >= 3) return CMD_ERROR;
 
@@ -268,13 +268,13 @@ int32 CmdPause(TileIndex tile, uint32 fl
 
int32 CmdMoneyCheat(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 
{
 
#ifndef _DEBUG
 
	if (_networking) return CMD_ERROR;
 
#endif
 
	SET_EXPENSES_TYPE(EXPENSES_OTHER);
 
	return (int32)p1;
 
	return -(int32)p1;
 
}
 

	
 
/** Transfer funds (money) from one player to another.
 
 * To prevent abuse in multiplayer games you can only send money to other
 
 * players if you have paid off your loan (either explicitely, or implicitely
 
 * given the fact that you have more money than loan).
 
@@ -293,13 +293,13 @@ int32 CmdGiveMoney(TileIndex tile, uint3
 
	if (p->money64 - p->current_loan < amount || amount <= 0) return CMD_ERROR;
 
	if (!_networking || !IsValidPlayer((PlayerID)p2)) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		/* Add money to player */
 
		PlayerID old_cp = _current_player;
 
		_current_player = p2;
 
		_current_player = (PlayerID)p2;
 
		SubtractMoneyFromPlayer(-amount);
 
		_current_player = old_cp;
 
	}
 

	
 
	/* Subtract money from local-player */
 
	return amount;