mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: player name text is still visible when suspended
This commit is contained in:
parent
d1ee86400f
commit
49aa7cdfba
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue