Fixed client crashing (temp.), fixed clients not spawning. (Fixes #1640 #1636 #1590 #1573)

This commit is contained in:
Shoghi Cervantes
2014-07-14 02:19:14 +02:00
parent eccd82ca4b
commit 6c442551f7
8 changed files with 89 additions and 73 deletions

View File

@@ -494,7 +494,7 @@ abstract class Entity extends Position implements Metadatable{
Server::broadcastPacket($this->hasSpawned, $pk);
}
if(!($this instanceof Player) and ($this->lastMotionX != $this->motionX or $this->lastMotionY != $this->motionY or $this->lastMotionZ != $this->motionZ)){
if(($this->lastMotionX != $this->motionX or $this->lastMotionY != $this->motionY or $this->lastMotionZ != $this->motionZ)){
$this->lastMotionX = $this->motionX;
$this->lastMotionY = $this->motionY;
$this->lastMotionZ = $this->motionZ;
@@ -504,6 +504,12 @@ abstract class Entity extends Position implements Metadatable{
[$this->getID(), $this->motionX, $this->motionY, $this->motionZ]
];
Server::broadcastPacket($this->hasSpawned, $pk);
if($this instanceof Player){
$this->motionX = 0;
$this->motionY = 0;
$this->motionZ = 0;
}
}
}
@@ -640,10 +646,10 @@ abstract class Entity extends Position implements Metadatable{
$entity->despawnFrom($this);
}
$pk = new UnloadChunkPacket();
/*$pk = new UnloadChunkPacket();
$pk->chunkX = $X;
$pk->chunkZ = $Z;
$this->dataPacket($pk);
$this->dataPacket($pk);*/
}
$this->getLevel()->freeAllChunks($this);
}