clean up 6x75 structure

This commit is contained in:
Martin Michelsen
2023-12-17 18:30:29 -08:00
parent da26fb0d14
commit de5547ff68
3 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -309,10 +309,10 @@ static void server_command_qset_qclear(shared_ptr<Client> c, const std::string&
}
if (is_v1_or_v2(c->version())) {
G_SetQuestFlag_DC_PC_6x75 cmd = {{0x75, 0x02, 0x0000}, flag_num, should_set ? 0 : 1};
G_UpdateQuestFlag_DC_PC_6x75 cmd = {{0x75, 0x02, 0x0000}, flag_num, should_set ? 0 : 1};
send_command_t(l, 0x60, 0x00, cmd);
} else {
G_SetQuestFlag_V3_BB_6x75 cmd = {{{0x75, 0x03, 0x0000}, flag_num, should_set ? 0 : 1}, l->difficulty, 0x0000};
G_UpdateQuestFlag_V3_BB_6x75 cmd = {{{0x75, 0x03, 0x0000}, flag_num, should_set ? 0 : 1}, l->difficulty, 0x0000};
send_command_t(l, 0x60, 0x00, cmd);
}
}
+3 -4
View File
@@ -4781,16 +4781,15 @@ struct G_WordSelect_6x74 {
WordSelectMessage message;
} __packed__;
// 6x75: Set quest flag
// 6x75: Update quest flag
struct G_SetQuestFlag_DC_PC_6x75 {
struct G_UpdateQuestFlag_DC_PC_6x75 {
G_UnusedHeader header;
le_uint16_t flag = 0; // Must be < 0x400
le_uint16_t action = 0; // 0 = set flag, 1 = clear flag
} __packed__;
struct G_SetQuestFlag_V3_BB_6x75 {
G_SetQuestFlag_DC_PC_6x75 basic_cmd;
struct G_UpdateQuestFlag_V3_BB_6x75 : G_UpdateQuestFlag_DC_PC_6x75 {
le_uint16_t difficulty = 0;
le_uint16_t unused = 0;
} __packed__;
+4 -4
View File
@@ -1689,14 +1689,14 @@ static void on_set_quest_flag(shared_ptr<Client> c, uint8_t command, uint8_t fla
uint16_t flag_index, difficulty, action;
if (is_v1_or_v2(c->version()) && (c->version() != Version::GC_NTE)) {
const auto& cmd = check_size_t<G_SetQuestFlag_DC_PC_6x75>(data, size);
const auto& cmd = check_size_t<G_UpdateQuestFlag_DC_PC_6x75>(data, size);
flag_index = cmd.flag;
action = cmd.action;
difficulty = l->difficulty;
} else {
const auto& cmd = check_size_t<G_SetQuestFlag_V3_BB_6x75>(data, size);
flag_index = cmd.basic_cmd.flag;
action = cmd.basic_cmd.action;
const auto& cmd = check_size_t<G_UpdateQuestFlag_V3_BB_6x75>(data, size);
flag_index = cmd.flag;
action = cmd.action;
difficulty = cmd.difficulty;
}