diff options
author | rubidium <rubidium@openttd.org> | 2007-03-02 01:17:11 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-03-02 01:17:11 +0000 |
commit | ea319b78f80fb970b1f394cf0853bb03c12ba475 (patch) | |
tree | b045a4c93b01abf5447be66d16bd305c4e9dcb4f /src/misc_cmd.cpp | |
parent | 89d8f5f7b5376850e8d2f0c1b72253d012ed9bed (diff) | |
download | openttd-ea319b78f80fb970b1f394cf0853bb03c12ba475.tar.xz |
(svn r8969) -Codechange: rework of the player face bits.
- introduce a new format (with backward compatability) that is more clear and needs a much simpler face drawer
- replace tons of ifs/switches/magic numbers by table lookups
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r-- | src/misc_cmd.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index 9eb9e6647..f0ddd2dfc 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -14,6 +14,7 @@ #include "network/network.h" #include "variables.h" #include "livery.h" +#include "player_face.h" /** Change the player's face. * @param tile unused @@ -22,8 +23,12 @@ */ int32 CmdSetPlayerFace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { + PlayerFace pf = (PlayerFace)p2; + + if (!IsValidPlayerFace(pf)) return CMD_ERROR; + if (flags & DC_EXEC) { - GetPlayer(_current_player)->face = p2; + GetPlayer(_current_player)->face = pf; MarkWholeScreenDirty(); } return 0; |