diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 368a216b..b2b1a0f3 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -227,6 +227,12 @@ void PlayerbotHolder::HandleBotPackets(WorldSession* session) { OpcodeClient opcode = static_cast(packet->GetOpcode()); ClientOpcodeHandler const* opHandle = opcodeTable[opcode]; + if (!opHandle) + { + LOG_ERROR("playerbots", "Unhandled opcode {} queued for bot session {}. Packet dropped.", static_cast(opcode), session->GetAccountId()); + delete packet; + continue; + } opHandle->Call(session, *packet); delete packet; }