Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove redundant "names" std::unordered_map from Player::getCorpse()
I've noticed redundant allocation of std::unordered_map together with its unneeded loop. The edited fragment of method, which is about creating corpse's description (Item* Player::getCorpse(Creature* lastHitCreature, Creature* mostDamageCreature)), does not need to check names[lastHitCreature->getName()] == 1 , which is the only place where the names map is actually used. It just serves no visible purpose, maybe it was meant to check if lastHitCreature is in getKillers(), which is a check if the lastHitCreature has hit the dead person in last minute... which is not needed, because lastHitCreature by its definition means that it is true.
- Loading branch information