mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 17:19:09 +00:00
(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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user