skip room unlock events in switch assist
This commit is contained in:
@@ -1245,7 +1245,8 @@ struct G_ItemSubcommand {
|
|||||||
struct G_SwitchStateChanged_6x05 {
|
struct G_SwitchStateChanged_6x05 {
|
||||||
uint8_t subcommand;
|
uint8_t subcommand;
|
||||||
uint8_t size;
|
uint8_t size;
|
||||||
parray<uint8_t, 8> unknown; // includes switch ID
|
le_uint16_t switch_id; // 0xFFFF for room clear when all enemies defeated
|
||||||
|
parray<uint8_t, 6> unknown;
|
||||||
uint8_t area;
|
uint8_t area;
|
||||||
uint8_t enabled;
|
uint8_t enabled;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -648,7 +648,7 @@ bool process_client_60_62_6C_6D_C9_CB<void>(shared_ptr<ServerState>,
|
|||||||
|
|
||||||
if (!data.empty() && (data[0] == 0x05) && session.enable_switch_assist) {
|
if (!data.empty() && (data[0] == 0x05) && session.enable_switch_assist) {
|
||||||
auto& cmd = check_size_t<G_SwitchStateChanged_6x05>(data);
|
auto& cmd = check_size_t<G_SwitchStateChanged_6x05>(data);
|
||||||
if (cmd.enabled) {
|
if (cmd.enabled && cmd.switch_id != 0xFFFF) {
|
||||||
if (session.last_switch_enabled_command.subcommand == 0x05) {
|
if (session.last_switch_enabled_command.subcommand == 0x05) {
|
||||||
session.log(INFO, "Switch assist: replaying previous enable command");
|
session.log(INFO, "Switch assist: replaying previous enable command");
|
||||||
session.send_to_end(true, 0x60, 0x00, &session.last_switch_enabled_command,
|
session.send_to_end(true, 0x60, 0x00, &session.last_switch_enabled_command,
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ static void process_subcommand_switch_state_changed(shared_ptr<ServerState>,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
forward_subcommand(l, c, command, flag, data);
|
forward_subcommand(l, c, command, flag, data);
|
||||||
if (cmd.enabled) {
|
if (cmd.enabled && cmd.switch_id != 0xFFFF) {
|
||||||
if ((l->flags & Lobby::Flag::CHEATS_ENABLED) && c->switch_assist &&
|
if ((l->flags & Lobby::Flag::CHEATS_ENABLED) && c->switch_assist &&
|
||||||
(c->last_switch_enabled_command.subcommand == 0x05)) {
|
(c->last_switch_enabled_command.subcommand == 0x05)) {
|
||||||
log(INFO, "[Switch assist] Replaying previous enable command");
|
log(INFO, "[Switch assist] Replaying previous enable command");
|
||||||
|
|||||||
Reference in New Issue
Block a user