Skip to content

Commit

Permalink
Stop sending players as entities on joins
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Flion committed Oct 12, 2023
1 parent 5b50a87 commit 0d87779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cubic-server/Dimension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "Server.hpp"
#include "World.hpp"
#include "entities/Entity.hpp"
#include "entities/EntityType.hpp"
#include "logging/logging.hpp"
#include "math/Vector3.hpp"
#include "protocol/ClientPackets.hpp"
Expand Down Expand Up @@ -258,7 +259,7 @@ void Dimension::spawnPlayer(Player &current)
{
std::lock_guard _(_entitiesMutex);
for (auto ent : _entities) {
if (ent->getId() == current_id)
if (ent->getType() == EntityType::Player)
continue;
current.sendSpawnEntity(*ent);
current.sendEntityMetadata(*ent);
Expand Down

0 comments on commit 0d87779

Please sign in to comment.