Removed redundant checks for a nullptr from PlayerManager::getPlayer()

These were written in desparation and never should have been there in
the first place.
This commit is contained in:
2020-12-01 20:18:01 +01:00
parent c43a3d64fb
commit 1e822f7a6c
10 changed files with 21 additions and 161 deletions

View File

@@ -69,8 +69,6 @@ void levelCommand(std::string full, std::vector<std::string>& args, CNSocket* so
}
Player *plr = PlayerManager::getPlayer(sock);
if (plr == nullptr)
return;
char *tmp;
int level = std::strtol(args[1].c_str(), &tmp, 10);
@@ -210,7 +208,7 @@ void summonWCommand(std::string full, std::vector<std::string>& args, CNSocket*
}
// permission & sanity check
if (plr == nullptr || type >= 3314)
if (type >= 3314)
return;
int team = NPCManager::NPCData[type]["m_iTeam"];
@@ -514,9 +512,6 @@ void eggCommand(std::string full, std::vector<std::string>& args, CNSocket* sock
Player* plr = PlayerManager::getPlayer(sock);
if (plr == nullptr)
return;
// some math to place egg nicely in front of the player
// temporarly disabled for sake of gruntwork
int addX = 0; //-500.0f * sin(plr->angle / 180.0f * M_PI);