fix item tracking in battle/challenge modes

This commit is contained in:
Martin Michelsen
2023-02-02 20:01:48 -08:00
parent 77f919980a
commit 64d7ec5cde
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -955,7 +955,7 @@ static void server_command_what(shared_ptr<ServerState>, shared_ptr<Lobby> l,
return;
}
if (!(l->flags & Lobby::Flag::ITEM_TRACKING_ENABLED)) {
send_text_message(c, u"$C4Item tracking is off");
send_text_message(c, u"$C4Item tracking is\nnot available");
} else {
float min_dist2 = 0.0f;
uint32_t nearest_item_id = 0xFFFFFFFF;
+8 -1
View File
@@ -3101,7 +3101,14 @@ shared_ptr<Lobby> create_game_generic(
return nullptr;
}
bool item_tracking_enabled = (c->version() == GameVersion::BB) | s->item_tracking_enabled;
// TODO: We disable item tracking for battle and challenge mode because
// players' inventories are reset when they start the quests, and the server
// is not notified when this happens. We'll have to implement this anyway for
// BB, but for now we ignore it.
bool item_tracking_enabled =
(c->version() == GameVersion::BB) |
(s->item_tracking_enabled &&
!(flags & (Lobby::Flag::BATTLE_MODE | Lobby::Flag::CHALLENGE_MODE)));
shared_ptr<Lobby> game = s->create_lobby();
game->name = name;
+1 -1
View File
@@ -1405,7 +1405,7 @@ subcommand_handler_t subcommand_handlers[0x100] = {
/* 87 */ nullptr,
/* 88 */ on_subcommand_forward_check_size_game,
/* 89 */ on_subcommand_forward_check_size_game,
/* 8A */ nullptr,
/* 8A */ on_subcommand_forward_check_size_game,
/* 8B */ nullptr,
/* 8C */ nullptr,
/* 8D */ on_subcommand_forward_check_size_client,