Do not cancel the ongoing race on recall

Also do not remove the player's vehicle if the player isn't on a
vehicle.
This commit is contained in:
dongresource 2020-12-29 14:31:48 +01:00
parent 55431362a7
commit c78b3ca69f
2 changed files with 4 additions and 8 deletions

View File

@ -532,7 +532,7 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) {
if (Warps.find(warpId) == Warps.end()) if (Warps.find(warpId) == Warps.end())
return; return;
if (plr->iPCState | 8) { if (plr->iPCState & 8) {
// remove the player's vehicle // remove the player's vehicle
plr->iPCState &= ~8; plr->iPCState &= ~8;
@ -582,7 +582,7 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) {
otherPlr->recallInstance = instanceID; otherPlr->recallInstance = instanceID;
// remove their vehicle if they're on one // remove their vehicle if they're on one
if (otherPlr->iPCState | 8) { if (otherPlr->iPCState & 8) {
// remove the player's vehicle // remove the player's vehicle
otherPlr->iPCState &= ~8; otherPlr->iPCState &= ~8;

View File

@ -101,10 +101,6 @@ void PlayerManager::removePlayer(CNSocket* key) {
it++; it++;
} }
// remove the player's ongoing race, if any
if (RacingManager::EPRaces.find(key) != RacingManager::EPRaces.end())
RacingManager::EPRaces.erase(key);
std::cout << players.size() << " players" << std::endl; std::cout << players.size() << " players" << std::endl;
} }
@ -175,8 +171,8 @@ void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I
// post-warp: check if the source instance has no more players in it and delete it if so // post-warp: check if the source instance has no more players in it and delete it if so
ChunkManager::destroyInstanceIfEmpty(fromInstance); ChunkManager::destroyInstanceIfEmpty(fromInstance);
// clean up EPRaces if we were likely in an IZ // clean up EPRaces if we were likely in an IZ and left
if (fromInstance != INSTANCE_OVERWORLD if (fromInstance != INSTANCE_OVERWORLD && fromInstance != I
&& RacingManager::EPRaces.find(sock) != RacingManager::EPRaces.end()) && RacingManager::EPRaces.find(sock) != RacingManager::EPRaces.end())
RacingManager::EPRaces.erase(sock); RacingManager::EPRaces.erase(sock);
} }