diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index 443cf52..c43f943 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -532,7 +532,7 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) { if (Warps.find(warpId) == Warps.end()) return; - if (plr->iPCState | 8) { + if (plr->iPCState & 8) { // remove the player's vehicle plr->iPCState &= ~8; @@ -582,7 +582,7 @@ void NPCManager::handleWarp(CNSocket* sock, int32_t warpId) { otherPlr->recallInstance = instanceID; // remove their vehicle if they're on one - if (otherPlr->iPCState | 8) { + if (otherPlr->iPCState & 8) { // remove the player's vehicle otherPlr->iPCState &= ~8; diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index 6a6a1a0..b383cb1 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -101,10 +101,6 @@ void PlayerManager::removePlayer(CNSocket* key) { 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; } @@ -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 ChunkManager::destroyInstanceIfEmpty(fromInstance); - // clean up EPRaces if we were likely in an IZ - if (fromInstance != INSTANCE_OVERWORLD + // clean up EPRaces if we were likely in an IZ and left + if (fromInstance != INSTANCE_OVERWORLD && fromInstance != I && RacingManager::EPRaces.find(sock) != RacingManager::EPRaces.end()) RacingManager::EPRaces.erase(sock); }