fix: player name text is still visible when suspended

This commit is contained in:
MihailRis 2026-02-18 00:30:16 +03:00
parent d1ee86400f
commit 49aa7cdfba

View file

@ -60,7 +60,7 @@ Decorator::Decorator(
"presets/text3d/player_name.toml"
));
for (const auto& [id, player] : *level.players) {
if (id == this->player.getId()) {
if (id == this->player.getId() || player->isSuspended()) {
continue;
}
playerTexts[id] = renderer.texts->add(std::make_unique<TextNote>(
@ -301,7 +301,7 @@ void Decorator::updateTextNotes() {
while (textsIter != playerTexts.end()) {
auto note = renderer.texts->get(textsIter->second);
auto player = level.players->get(textsIter->first);
if (player == nullptr) {
if (player == nullptr || player->isSuspended()) {
renderer.texts->remove(textsIter->second);
textsIter = playerTexts.erase(textsIter);
} else {