mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
moved initialization of entity
This commit is contained in:
parent
ece83db6ed
commit
0bf2d398ea
@ -1013,15 +1013,15 @@ void HandlePacket(Packet* packet) {
|
|||||||
Character* c = user->GetLastUsedChar();
|
Character* c = user->GetLastUsedChar();
|
||||||
if (c != nullptr) {
|
if (c != nullptr) {
|
||||||
std::u16string username = GeneralUtils::ASCIIToUTF16(c->GetName());
|
std::u16string username = GeneralUtils::ASCIIToUTF16(c->GetName());
|
||||||
WorldPackets::SendCreateCharacter(packet->systemAddress, c->GetObjectID(), c->GetXMLData(), username, c->GetGMLevel());
|
|
||||||
WorldPackets::SendServerState(packet->systemAddress);
|
|
||||||
|
|
||||||
Game::server->GetReplicaManager()->AddParticipant(packet->systemAddress);
|
Game::server->GetReplicaManager()->AddParticipant(packet->systemAddress);
|
||||||
|
|
||||||
EntityInfo info {};
|
EntityInfo info {};
|
||||||
info.lot = 1;
|
info.lot = 1;
|
||||||
Entity* player = EntityManager::Instance()->CreateEntity(info, UserManager::Instance()->GetUser(packet->systemAddress));
|
Entity* player = EntityManager::Instance()->CreateEntity(info, UserManager::Instance()->GetUser(packet->systemAddress));
|
||||||
|
|
||||||
|
WorldPackets::SendCreateCharacter(packet->systemAddress, player, c->GetXMLData(), username, c->GetGMLevel());
|
||||||
|
WorldPackets::SendServerState(packet->systemAddress);
|
||||||
|
|
||||||
const auto respawnPoint = player->GetCharacter()->GetRespawnPoint(dZoneManager::Instance()->GetZone()->GetWorldID());
|
const auto respawnPoint = player->GetCharacter()->GetRespawnPoint(dZoneManager::Instance()->GetZone()->GetWorldID());
|
||||||
|
|
||||||
EntityManager::Instance()->ConstructEntity(player, UNASSIGNED_SYSTEM_ADDRESS, true);
|
EntityManager::Instance()->ConstructEntity(player, UNASSIGNED_SYSTEM_ADDRESS, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user