mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(voice): limit voice message range to 48 units
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "Cubed/gameplay/session.hpp"
|
||||
#include "Cubed/tools/cubed_assert.hpp"
|
||||
#include "Cubed/tools/log.hpp"
|
||||
#include "Cubed/tools/math_tools.hpp"
|
||||
#include "Cubed/tools/uuid.hpp"
|
||||
|
||||
#include <ranges>
|
||||
@@ -787,6 +788,9 @@ void ServerWorld::handle_voice_message(VoiceMsg& msg) {
|
||||
if (key == uuid) {
|
||||
continue;
|
||||
}
|
||||
if (Math::distance2(p, player.get_pos()) > 48.0f * 48.0f) {
|
||||
continue;
|
||||
}
|
||||
session.emplace_back(player.get_session());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user