summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp7
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;