fixed some players being invisible if they join while other players are joining

This commit is contained in:
GameHerobrine 2025-07-17 13:53:33 +03:00
parent aa39b77156
commit 26516699c7
2 changed files with 3 additions and 3 deletions

View file

@ -215,8 +215,8 @@ class EntityAPI{
public function spawnToAll(Entity $e){
foreach($this->server->api->player->getAll($e->level) as $player){
if($player->eid != false and $player->eid != $e->eid and $e->class != ENTITY_PLAYER and $e instanceof Entity){
if($e->closed !== false or ($player->level !== $e->level and $e->class !== ENTITY_PLAYER)){
if($player->spawned && $player->eid != false && $player->eid != $e->eid && $e->class != ENTITY_PLAYER && $e instanceof Entity){
if($e->closed !== false || ($player->level !== $e->level && $e->class !== ENTITY_PLAYER)){
return false;
}

View file

@ -497,7 +497,7 @@ class PlayerAPI{
public function spawnToAllPlayers(Player $player){
foreach($this->getAll() as $p){
if($p !== $player and ($p->entity instanceof Entity) and ($player->entity instanceof Entity)){
if($p->spawned && $p !== $player && ($p->entity instanceof Entity) && ($player->entity instanceof Entity)){
$player->entity->spawn($p);
if($p->level !== $player->level){
$pk = new MoveEntityPacket_PosRot;