mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +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.slot = player->slot;
|
||||||
result.Taros = player->money;
|
result.Taros = player->money;
|
||||||
result.TutorialFlag = player->PCStyle2.iTutorialFlag;
|
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.x_coordinates = player->x;
|
||||||
result.y_coordinates = player->y;
|
result.y_coordinates = player->y;
|
||||||
result.z_coordinates = player->z;
|
result.z_coordinates = player->z;
|
||||||
|
@ -50,6 +50,7 @@ struct Player {
|
|||||||
bool isTradeConfirm;
|
bool isTradeConfirm;
|
||||||
|
|
||||||
bool inCombat;
|
bool inCombat;
|
||||||
|
bool onMonkey;
|
||||||
bool passiveNanoOut;
|
bool passiveNanoOut;
|
||||||
int healCooldown;
|
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) {
|
void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z, uint64_t I) {
|
||||||
Player* plr = getPlayer(sock);
|
Player* plr = getPlayer(sock);
|
||||||
|
plr->onMonkey = false;
|
||||||
|
|
||||||
if (plr->instanceID == INSTANCE_OVERWORLD) {
|
if (plr->instanceID == INSTANCE_OVERWORLD) {
|
||||||
// save last uninstanced coords
|
// 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);
|
PlayerManager::updatePlayerPosition(sock, target.x, target.y, target.z, INSTANCE_OVERWORLD, plr->angle);
|
||||||
break;
|
break;
|
||||||
case 2: // Monkey Skyway
|
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
|
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
|
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
|
SkywayQueues[sock] = SkywayPaths[route.mssRouteNum]; // set socket point queue to route
|
||||||
|
plr->onMonkey = true;
|
||||||
break;
|
break;
|
||||||
} else if (TableData::RunningSkywayRoutes.find(route.mssRouteNum) != TableData::RunningSkywayRoutes.end()) {
|
} else if (TableData::RunningSkywayRoutes.find(route.mssRouteNum) != TableData::RunningSkywayRoutes.end()) {
|
||||||
std::vector<WarpLocation>* _route = &TableData::RunningSkywayRoutes[route.mssRouteNum];
|
std::vector<WarpLocation>* _route = &TableData::RunningSkywayRoutes[route.mssRouteNum];
|
||||||
|
|
||||||
NanoManager::summonNano(sock, -1);
|
NanoManager::summonNano(sock, -1);
|
||||||
testMssRoute(sock, _route);
|
testMssRoute(sock, _route);
|
||||||
|
plr->onMonkey = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,6 +240,7 @@ void TransportManager::stepSkywaySystem() {
|
|||||||
// send packet to players in view
|
// send packet to players in view
|
||||||
PlayerManager::sendToViewable(it->first, (void*)&rideBroadcast, P_FE2CL_PC_RIDING, sizeof(sP_FE2CL_PC_RIDING));
|
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
|
it = SkywayQueues.erase(it); // remove player from tracking map + update iterator
|
||||||
|
plr->onMonkey = false;
|
||||||
} else {
|
} else {
|
||||||
WarpLocation point = queue->front(); // get point
|
WarpLocation point = queue->front(); // get point
|
||||||
queue->pop(); // remove point from front of queue
|
queue->pop(); // remove point from front of queue
|
||||||
|
Loading…
Reference in New Issue
Block a user