disable equip tracking in non-BB games
This commit is contained in:
@@ -1155,9 +1155,11 @@ static void on_equip_item(shared_ptr<Client> c, uint8_t command, uint8_t flag, c
|
|||||||
|
|
||||||
auto l = c->require_lobby();
|
auto l = c->require_lobby();
|
||||||
if (l->check_flag(Lobby::Flag::ITEM_TRACKING_ENABLED)) {
|
if (l->check_flag(Lobby::Flag::ITEM_TRACKING_ENABLED)) {
|
||||||
EquipSlot slot = static_cast<EquipSlot>(cmd.equip_slot.load());
|
if (l->base_version == GameVersion::BB) {
|
||||||
auto p = c->game_data.character();
|
EquipSlot slot = static_cast<EquipSlot>(cmd.equip_slot.load());
|
||||||
p->inventory.equip_item(cmd.item_id, slot);
|
auto p = c->game_data.character();
|
||||||
|
p->inventory.equip_item(cmd.item_id, slot);
|
||||||
|
}
|
||||||
} else if (l->base_version == GameVersion::BB) {
|
} else if (l->base_version == GameVersion::BB) {
|
||||||
throw logic_error("item tracking not enabled in BB game");
|
throw logic_error("item tracking not enabled in BB game");
|
||||||
}
|
}
|
||||||
@@ -1174,8 +1176,10 @@ static void on_unequip_item(shared_ptr<Client> c, uint8_t command, uint8_t flag,
|
|||||||
|
|
||||||
auto l = c->require_lobby();
|
auto l = c->require_lobby();
|
||||||
if (l->check_flag(Lobby::Flag::ITEM_TRACKING_ENABLED)) {
|
if (l->check_flag(Lobby::Flag::ITEM_TRACKING_ENABLED)) {
|
||||||
auto p = c->game_data.character();
|
if (l->base_version == GameVersion::BB) {
|
||||||
p->inventory.unequip_item(cmd.item_id);
|
auto p = c->game_data.character();
|
||||||
|
p->inventory.unequip_item(cmd.item_id);
|
||||||
|
}
|
||||||
} else if (l->base_version == GameVersion::BB) {
|
} else if (l->base_version == GameVersion::BB) {
|
||||||
throw logic_error("item tracking not enabled in BB game");
|
throw logic_error("item tracking not enabled in BB game");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user