mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-26 15:00:06 +00:00
Fixed the NULL Player* in PlayerManager::players bug.
This commit is contained in:
parent
2b650b0bed
commit
3b5af415fb
@ -31,6 +31,7 @@ void CNShardServer::handlePacket(CNSocket* sock, CNPacketData* data) {
|
|||||||
else if (settings::VERBOSITY > 0)
|
else if (settings::VERBOSITY > 0)
|
||||||
std::cerr << "OpenFusion: SHARD UNIMPLM ERR. PacketType: " << Defines::p2str(CL2FE, data->type) << " (" << data->type << ")" << std::endl;
|
std::cerr << "OpenFusion: SHARD UNIMPLM ERR. PacketType: " << Defines::p2str(CL2FE, data->type) << " (" << data->type << ")" << std::endl;
|
||||||
|
|
||||||
|
if (PlayerManager::players.find(sock) != PlayerManager::players.end())
|
||||||
PlayerManager::players[sock].lastHeartbeat = getTime();
|
PlayerManager::players[sock].lastHeartbeat = getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -578,12 +578,12 @@ void MobManager::roamingStep(Mob *mob, time_t currTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MobManager::retreatStep(Mob *mob, time_t currTime) {
|
void MobManager::retreatStep(Mob *mob, time_t currTime) {
|
||||||
// distance between spawn point and current location
|
|
||||||
if (mob->nextMovement != 0 && currTime < mob->nextMovement)
|
if (mob->nextMovement != 0 && currTime < mob->nextMovement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mob->nextMovement = currTime + 500;
|
mob->nextMovement = currTime + 500;
|
||||||
|
|
||||||
|
// distance between spawn point and current location
|
||||||
int distance = hypot(mob->appearanceData.iX - mob->roamX, mob->appearanceData.iY - mob->roamY);
|
int distance = hypot(mob->appearanceData.iX - mob->roamX, mob->appearanceData.iY - mob->roamY);
|
||||||
|
|
||||||
//if (distance > mob->data["m_iIdleRange"]) {
|
//if (distance > mob->data["m_iIdleRange"]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user