(svn r18783) -Codechange: make CheckCompanyHasMoney set an error on the CommandCost it tests when you don't have enough money instead of setting a global variable.
This commit is contained in:
@@ -107,6 +107,17 @@ public:
|
||||
if (this->message != INVALID_STRING_ID) _error_message = this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes this CommandCost behave like an error command.
|
||||
* @param mesasge the error message.
|
||||
*/
|
||||
void MakeError(StringID message)
|
||||
{
|
||||
assert(message != INVALID_STRING_ID);
|
||||
this->success = false;
|
||||
this->message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the error message of a command
|
||||
* @return the error message, if succeeded INVALID_STRING_ID
|
||||
|
Reference in New Issue
Block a user