mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Possible fix for #2041
This commit is contained in:
parent
0eac084aa7
commit
dea4513c34
@ -801,7 +801,12 @@ class Server{
|
|||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
public function removePlayer(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
|
* @param int $taskId
|
||||||
*/
|
*/
|
||||||
public function cancelTask($taskId){
|
public function cancelTask($taskId){
|
||||||
if(isset($this->tasks[$taskId])){
|
if($taskId !== null and isset($this->tasks[$taskId])){
|
||||||
$this->tasks[$taskId]->cancel();
|
$this->tasks[$taskId]->cancel();
|
||||||
unset($this->tasks[$taskId]);
|
unset($this->tasks[$taskId]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user