24
src/goal.cpp
24
src/goal.cpp
@@ -78,7 +78,7 @@ INSTANTIATE_POOL_METHODS(Goal)
|
||||
* @param text Text of the goal.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (!Goal::CanAllocateItem()) return CMD_ERROR;
|
||||
|
||||
@@ -125,7 +125,7 @@ CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
* @param text unused.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -157,7 +157,7 @@ CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
* @param p2 GoalTypeID of destination.
|
||||
* @param text unused.
|
||||
*/
|
||||
CommandCost CmdSetGoalDestination(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, uint64 p3, const char *text, const CommandAuxiliaryBase *aux_data)
|
||||
CommandCost CmdSetGoalDestination(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, uint64_t p3, const char *text, const CommandAuxiliaryBase *aux_data)
|
||||
{
|
||||
GoalID goal = p1;
|
||||
GoalTypeID dest = p2;
|
||||
@@ -185,7 +185,7 @@ CommandCost CmdSetGoalDestination(TileIndex tile, DoCommandFlag flags, uint32 p1
|
||||
* @param text Text of the goal.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -218,7 +218,7 @@ CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
* @param text Progress text of the goal.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -250,7 +250,7 @@ CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -284,17 +284,17 @@ CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
* @param text Text of the question.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, uint64 p3, const char *text, const CommandAuxiliaryBase *aux_data)
|
||||
CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, uint64_t p3, const char *text, const CommandAuxiliaryBase *aux_data)
|
||||
{
|
||||
uint16 uniqueid = (uint16)GB(p1, 0, 16);
|
||||
uint16_t uniqueid = (uint16_t)GB(p1, 0, 16);
|
||||
CompanyID company = (CompanyID)GB(p3, 0, 32);
|
||||
ClientID client = (ClientID)GB(p3, 0, 32);
|
||||
|
||||
static_assert(sizeof(uint32) >= sizeof(CompanyID));
|
||||
static_assert(sizeof(uint32) >= sizeof(ClientID));
|
||||
static_assert(sizeof(uint32_t) >= sizeof(CompanyID));
|
||||
static_assert(sizeof(uint32_t) >= sizeof(ClientID));
|
||||
|
||||
static_assert(GOAL_QUESTION_BUTTON_COUNT < 29);
|
||||
uint32 button_mask = GB(p2, 0, GOAL_QUESTION_BUTTON_COUNT);
|
||||
uint32_t button_mask = GB(p2, 0, GOAL_QUESTION_BUTTON_COUNT);
|
||||
byte type = GB(p2, 29, 2);
|
||||
bool is_client = HasBit(p2, 31);
|
||||
|
||||
@@ -334,7 +334,7 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
* @param text Text of the question.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdGoalQuestionAnswer(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||
CommandCost CmdGoalQuestionAnswer(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
|
||||
{
|
||||
if (p1 > UINT16_MAX) return CMD_ERROR;
|
||||
if (p2 >= GOAL_QUESTION_BUTTON_COUNT) return CMD_ERROR;
|
||||
|
Reference in New Issue
Block a user