Codechange: Move flags in CommandProc in front of the command arguments.
This commit is contained in:
28
src/goal.cpp
28
src/goal.cpp
@@ -35,8 +35,8 @@ INSTANTIATE_POOL_METHODS(Goal)
|
||||
|
||||
/**
|
||||
* Create a new goal.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 various bitstuffed elements
|
||||
* - p1 = (bit 0 - 7) - GoalType of destination.
|
||||
* - p1 = (bit 8 - 15) - Company for which this goal is.
|
||||
@@ -44,7 +44,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 std::string &text)
|
||||
CommandCost CmdCreateGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (!Goal::CanAllocateItem()) return CMD_ERROR;
|
||||
|
||||
@@ -110,14 +110,14 @@ CommandCost CmdCreateGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
|
||||
/**
|
||||
* Remove a goal.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 GoalID to remove.
|
||||
* @param p2 unused.
|
||||
* @param text unused.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text)
|
||||
CommandCost CmdRemoveGoal(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -140,14 +140,14 @@ CommandCost CmdRemoveGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
|
||||
/**
|
||||
* Update goal text of a goal.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 GoalID to update.
|
||||
* @param p2 unused
|
||||
* @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 std::string &text)
|
||||
CommandCost CmdSetGoalText(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -170,14 +170,14 @@ CommandCost CmdSetGoalText(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
/**
|
||||
* Update progress text of a goal.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 GoalID to update.
|
||||
* @param p2 unused
|
||||
* @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 std::string &text)
|
||||
CommandCost CmdSetGoalProgress(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -203,14 +203,14 @@ CommandCost CmdSetGoalProgress(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
|
||||
/**
|
||||
* Update completed state of a goal.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 GoalID to update.
|
||||
* @param p2 completed state. If goal is completed, set to 1, otherwise 0.
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text)
|
||||
CommandCost CmdSetGoalCompleted(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||
if (!Goal::IsValidID(p1)) return CMD_ERROR;
|
||||
@@ -231,8 +231,8 @@ CommandCost CmdSetGoalCompleted(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||
|
||||
/**
|
||||
* Ask a goal related question
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 various bitstuffed elements
|
||||
* - p1 = (bit 0 - 15) - Unique ID to use for this question.
|
||||
* - p1 = (bit 16 - 31) - Company or client for which this question is.
|
||||
@@ -243,7 +243,7 @@ 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, const std::string &text)
|
||||
CommandCost CmdGoalQuestion(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
uint16 uniqueid = (uint16)GB(p1, 0, 16);
|
||||
CompanyID company = (CompanyID)GB(p1, 16, 8);
|
||||
@@ -283,14 +283,14 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
|
||||
/**
|
||||
* Reply to a goal question.
|
||||
* @param tile unused.
|
||||
* @param flags type of operation
|
||||
* @param tile unused.
|
||||
* @param p1 Unique ID to use for this question.
|
||||
* @param p2 Button the company pressed
|
||||
* @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 std::string &text)
|
||||
CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, TileIndex tile, uint32 p1, uint32 p2, const std::string &text)
|
||||
{
|
||||
if (p1 > UINT16_MAX) return CMD_ERROR;
|
||||
if (p2 >= GOAL_QUESTION_BUTTON_COUNT) return CMD_ERROR;
|
||||
|
Reference in New Issue
Block a user