Player: do not allow doFirstSpawn() to be executed before the constructor is called

this problem doesn't exist on PM4.
This commit is contained in:
Dylan K. Taylor 2021-09-05 15:38:14 +01:00
parent 1c2eb35025
commit 85eb6b30a5
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1073,7 +1073,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
* @return void
*/
public function doFirstSpawn(){
if($this->spawned){
if($this->spawned || !$this->constructed){
return; //avoid player spawning twice (this can only happen on 3.x with a custom malicious client)
}
$this->spawned = true;