Add missing sanity checks to quitTask and useItem

This commit is contained in:
Gent S
2020-10-25 18:33:02 -04:00
parent 609d3cdb99
commit f3b9ecd791
2 changed files with 4 additions and 4 deletions

View File

@@ -229,8 +229,8 @@ void MissionManager::quitMission(CNSocket* sock, CNPacketData* data) {
void MissionManager::quitTask(CNSocket* sock, int32_t taskNum, bool manual) {
Player* plr = PlayerManager::getPlayer(sock);
if (plr == nullptr)
return;
if (plr == nullptr || Tasks.find(taskNum) == Tasks.end())
return; // sanity check
// update player
int i;