static */
| 126 | } |
| 127 | |
| 128 | /* static */ bool ScriptGoal::DoQuestion(SQInteger uniqueid, uint32_t target, bool is_client, Text *question, QuestionType type, SQInteger buttons) |
| 129 | { |
| 130 | ScriptObjectRef counter(question); |
| 131 | |
| 132 | EnforceDeityMode(false); |
| 133 | EnforcePrecondition(false, question != nullptr); |
| 134 | EncodedString text = question->GetEncodedText(); |
| 135 | EnforcePreconditionEncodedText(false, text); |
| 136 | uint min_buttons = (type == QT_QUESTION ? 1 : 0); |
| 137 | EnforcePrecondition(false, CountBits<uint64_t>(buttons) >= min_buttons && CountBits<uint64_t>(buttons) <= 3); |
| 138 | EnforcePrecondition(false, buttons >= 0 && buttons < (1 << ::GOAL_QUESTION_BUTTON_COUNT)); |
| 139 | EnforcePrecondition(false, (int)type < ::GQT_END); |
| 140 | EnforcePrecondition(false, uniqueid >= 0 && uniqueid <= UINT16_MAX); |
| 141 | |
| 142 | return ScriptObject::Command<CMD_GOAL_QUESTION>::Do(uniqueid, target, is_client, buttons, (::GoalQuestionType)type, text); |
| 143 | } |
| 144 | |
| 145 | /* static */ bool ScriptGoal::Question(SQInteger uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, SQInteger buttons) |
| 146 | { |
nothing calls this directly
no test coverage detected