Prevent bad access potential for removals by checking bounds (#4617)

* Prevent bad access potential for removals by checking bounds
Fix #4616

Switch to removeOne instead of bound checking removeAt

* Revert server cardzone check
This commit is contained in:
Zach H 2022-05-08 14:26:50 -04:00 committed by GitHub
parent b02adccf87
commit 3e90f109a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 12 deletions

View file

@ -53,7 +53,7 @@ void GameScene::removePlayer(Player *player)
zone->close();
}
}
players.removeAt(players.indexOf(player));
players.removeOne(player);
removeItem(player);
rearrange();
}
@ -178,7 +178,7 @@ void GameScene::addRevealedZoneView(Player *player,
void GameScene::removeZoneView(ZoneViewWidget *item)
{
zoneViews.removeAt(zoneViews.indexOf(item));
zoneViews.removeOne(item);
removeItem(item);
}