Fixing item toggle

Now the toggle is set via per room.
This commit is contained in:
Reason
2023-06-09 22:11:07 -04:00
committed by Martin Michelsen
parent 3ef2f76705
commit 53a9b527e4
4 changed files with 15 additions and 17 deletions
+4 -6
View File
@@ -953,7 +953,6 @@ static void on_sort_inventory_bb(shared_ptr<ServerState>,
// EXP/Drop Item commands
static bool drop_item(
std::shared_ptr<ServerState>s,
std::shared_ptr<Lobby> l,
int64_t enemy_id,
uint8_t area,
@@ -979,7 +978,6 @@ static bool drop_item(
} else {
item.data = l->item_creator->on_box_item_drop(area);
}
item.data.id = l->generate_item_id(0xFF);
if (l->flags & Lobby::Flag::ITEM_TRACKING_ENABLED) {
@@ -989,7 +987,7 @@ static bool drop_item(
return true;
}
static void on_enemy_drop_item_request(shared_ptr<ServerState> s,
static void on_enemy_drop_item_request(shared_ptr<ServerState>,
shared_ptr<Lobby> l, shared_ptr<Client> c, uint8_t command, uint8_t flag,
const string& data) {
if (!l->is_game()) {
@@ -999,12 +997,12 @@ static void on_enemy_drop_item_request(shared_ptr<ServerState> s,
const auto& cmd = check_size_sc<G_EnemyDropItemRequest_DC_6x60>(data,
sizeof(G_EnemyDropItemRequest_DC_6x60),
sizeof(G_EnemyDropItemRequest_PC_V3_BB_6x60));
if (!drop_item(s, l, cmd.enemy_id, cmd.area, cmd.x, cmd.z, cmd.enemy_id)) {
if (!drop_item(l, cmd.enemy_id, cmd.area, cmd.x, cmd.z, cmd.enemy_id)) {
forward_subcommand(l, c, command, flag, data);
}
}
static void on_box_drop_item_request(shared_ptr<ServerState>s,
static void on_box_drop_item_request(shared_ptr<ServerState>,
shared_ptr<Lobby> l, shared_ptr<Client> c, uint8_t command, uint8_t flag,
const string& data) {
if (!l->is_game()) {
@@ -1012,7 +1010,7 @@ static void on_box_drop_item_request(shared_ptr<ServerState>s,
}
const auto& cmd = check_size_sc<G_BoxItemDropRequest_6xA2>(data);
if (!drop_item(s, l, -1, cmd.area, cmd.x, cmd.z, cmd.request_id)) {
if (!drop_item(l, -1, cmd.area, cmd.x, cmd.z, cmd.request_id)) {
forward_subcommand(l, c, command, flag, data);
}
}