[Player] Stop reaching into graphics_item and emit signals instead for conceded and zoneId (#6912)

* [Player] Stop reaching into graphics_item and emit signals instead for conceded and zoneId

Took 7 minutes

Took 3 seconds

* Add sameValue check.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-05-19 12:22:40 +02:00 committed by GitHub
parent af2f888293
commit 9f1c225b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View file

@ -89,7 +89,6 @@ void Player::setConceded(bool _conceded)
if (conceded != _conceded) {
conceded = _conceded;
getGraphicsItem()->setVisible(!conceded);
if (conceded) {
clear();
}
@ -99,8 +98,10 @@ void Player::setConceded(bool _conceded)
void Player::setZoneId(int _zoneId)
{
zoneId = _zoneId;
graphicsItem->getPlayerArea()->setPlayerZoneId(zoneId);
if (zoneId != _zoneId) {
zoneId = _zoneId;
emit zoneIdChanged(zoneId);
}
}
void Player::processPlayerInfo(const ServerInfo_Player &info)