mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-25 22:40:16 +00:00
Fix freefalling after MSS DC
This commit is contained in:
parent
fa7b6e6145
commit
faf2a0ee7d
@ -472,7 +472,7 @@ Database::DbPlayer Database::playerToDb(Player *player) {
|
||||
result.slot = player->slot;
|
||||
result.Taros = player->money;
|
||||
result.TutorialFlag = player->PCStyle2.iTutorialFlag;
|
||||
if (player->instanceID == 0) { // only save coords if player isn't instanced
|
||||
if (player->instanceID == 0 && !player->onMonkey) { // only save coords if player isn't instanced
|
||||
result.x_coordinates = player->x;
|
||||
result.y_coordinates = player->y;
|
||||
result.z_coordinates = player->z;
|
||||
|
@ -50,6 +50,7 @@ struct Player {
|
||||
bool isTradeConfirm;
|
||||
|
||||
bool inCombat;
|
||||
bool onMonkey;
|
||||
bool passiveNanoOut;
|
||||
int healCooldown;
|
||||
|
||||
|
@ -118,6 +118,7 @@ void PlayerManager::updatePlayerPosition(CNSocket* sock, int X, int Y, int Z, ui
|
||||
|
||||
void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I) {
|
||||
Player* plr = getPlayer(sock);
|
||||
plr->onMonkey = false;
|
||||
|
||||
if (plr->instanceID == INSTANCE_OVERWORLD) {
|
||||
// save last uninstanced coords
|
||||
|
@ -146,15 +146,20 @@ void TransportManager::transportWarpHandler(CNSocket* sock, CNPacketData* data)
|
||||
PlayerManager::updatePlayerPosition(sock, target.x, target.y, target.z, INSTANCE_OVERWORLD, plr->angle);
|
||||
break;
|
||||
case 2: // Monkey Skyway
|
||||
// set last safe coords
|
||||
plr->lastX = plr->x;
|
||||
plr->lastY = plr->y;
|
||||
plr->lastZ = plr->z;
|
||||
if (SkywayPaths.find(route.mssRouteNum) != SkywayPaths.end()) { // check if route exists
|
||||
NanoManager::summonNano(sock, -1); // make sure that no nano is active during the ride
|
||||
SkywayQueues[sock] = SkywayPaths[route.mssRouteNum]; // set socket point queue to route
|
||||
plr->onMonkey = true;
|
||||
break;
|
||||
} else if (TableData::RunningSkywayRoutes.find(route.mssRouteNum) != TableData::RunningSkywayRoutes.end()) {
|
||||
std::vector<WarpLocation>* _route = &TableData::RunningSkywayRoutes[route.mssRouteNum];
|
||||
|
||||
NanoManager::summonNano(sock, -1);
|
||||
testMssRoute(sock, _route);
|
||||
plr->onMonkey = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -235,6 +240,7 @@ void TransportManager::stepSkywaySystem() {
|
||||
// send packet to players in view
|
||||
PlayerManager::sendToViewable(it->first, (void*)&rideBroadcast, P_FE2CL_PC_RIDING, sizeof(sP_FE2CL_PC_RIDING));
|
||||
it = SkywayQueues.erase(it); // remove player from tracking map + update iterator
|
||||
plr->onMonkey = false;
|
||||
} else {
|
||||
WarpLocation point = queue->front(); // get point
|
||||
queue->pop(); // remove point from front of queue
|
||||
|
Loading…
Reference in New Issue
Block a user