Fix: make script goals work with the whole range of ClientIDs

This commit is contained in:
Rubidium
2023-01-31 16:59:58 +01:00
committed by rubidium42
parent 67e1d1ad89
commit 31869501ee
4 changed files with 6 additions and 6 deletions

View File

@@ -137,8 +137,6 @@
{
EnforcePrecondition(false, ScriptGame::IsMultiplayer());
EnforcePrecondition(false, ScriptClient::ResolveClientID(client) != ScriptClient::CLIENT_INVALID);
/* Can only send 16 bits of client_id before proper fix is implemented */
EnforcePrecondition(false, client < (1 << 16));
return DoQuestion(uniqueid, client, true, question, type, buttons);
}

View File

@@ -170,7 +170,7 @@ public:
* @pre question != null && len(question) != 0.
* @pre company == COMPANY_INVALID || ResolveCompanyID(company) != COMPANY_INVALID.
* @pre CountBits(buttons) >= 1 && CountBits(buttons) <= 3.
* @note Replies to the question are given by you via the event ScriptEvent_GoalQuestionAnswer.
* @note Replies to the question are given by you via the event ScriptEventGoalQuestionAnswer.
* @note There is no guarantee you ever get a reply on your question.
*/
static bool Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, int buttons);
@@ -188,7 +188,7 @@ public:
* @pre question != null && len(question) != 0.
* @pre ResolveClientID(client) != CLIENT_INVALID.
* @pre CountBits(buttons) >= 1 && CountBits(buttons) <= 3.
* @note Replies to the question are given by you via the event ScriptEvent_GoalQuestionAnswer.
* @note Replies to the question are given by you via the event ScriptEventGoalQuestionAnswer.
* @note There is no guarantee you ever get a reply on your question.
*/
static bool QuestionClient(uint16 uniqueid, ScriptClient::ClientID client, Text *question, QuestionType type, int buttons);