mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Possible fix for #2041
This commit is contained in:
parent
0eac084aa7
commit
dea4513c34
@ -801,7 +801,12 @@ class Server{
|
||||
* @param Player $player
|
||||
*/
|
||||
public function removePlayer(Player $player){
|
||||
unset($this->players[$player->getAddress() . ":" . $player->getPort()]);
|
||||
foreach($this->players as $identifier => $p){
|
||||
if($player === $p){
|
||||
unset($this->players[$identifier]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,7 +119,7 @@ class ServerScheduler{
|
||||
* @param int $taskId
|
||||
*/
|
||||
public function cancelTask($taskId){
|
||||
if(isset($this->tasks[$taskId])){
|
||||
if($taskId !== null and isset($this->tasks[$taskId])){
|
||||
$this->tasks[$taskId]->cancel();
|
||||
unset($this->tasks[$taskId]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user