equal
deleted
inserted
replaced
1 /* $Id$ */ |
1 /* $Id$ */ |
|
2 |
|
3 /** @file misc_cmd.cpp */ |
2 |
4 |
3 #include "stdafx.h" |
5 #include "stdafx.h" |
4 #include "openttd.h" |
6 #include "openttd.h" |
5 #include "functions.h" |
7 #include "functions.h" |
6 #include "string.h" |
8 #include "string.h" |
12 #include "gui.h" |
14 #include "gui.h" |
13 #include "economy.h" |
15 #include "economy.h" |
14 #include "network/network.h" |
16 #include "network/network.h" |
15 #include "variables.h" |
17 #include "variables.h" |
16 #include "livery.h" |
18 #include "livery.h" |
|
19 #include "player_face.h" |
17 |
20 |
18 /** Change the player's face. |
21 /** Change the player's face. |
19 * @param tile unused |
22 * @param tile unused |
20 * @param p1 unused |
23 * @param p1 unused |
21 * @param p2 face bitmasked |
24 * @param p2 face bitmasked |
22 */ |
25 */ |
23 int32 CmdSetPlayerFace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
26 int32 CmdSetPlayerFace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
24 { |
27 { |
25 if (flags & DC_EXEC) { |
28 PlayerFace pf = (PlayerFace)p2; |
26 GetPlayer(_current_player)->face = p2; |
29 |
|
30 if (!IsValidPlayerFace(pf)) return CMD_ERROR; |
|
31 |
|
32 if (flags & DC_EXEC) { |
|
33 GetPlayer(_current_player)->face = pf; |
27 MarkWholeScreenDirty(); |
34 MarkWholeScreenDirty(); |
28 } |
35 } |
29 return 0; |
36 return 0; |
30 } |
37 } |
31 |
38 |