Skip to content

Commit bfd1daf

Browse files
committed
Merge pull request #71 from AndreTheGamer/revert-67-master
Revert "Fixed ClearInv Bug"
2 parents 22ecf82 + 7bc517b commit bfd1daf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Andre/SurvivalGame/Main.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ public function PlayerDeath(PlayerDeathEvent $event){
447447
{
448448
if(isset($this->players[$event->getEntity()->getName()]))
449449
{
450+
$this->ClearInv($event->getEntity());
450451
unset($this->players[$event->getEntity()->getName()]);
451452
if(count($this->players)>1)
452453
{
@@ -588,6 +589,7 @@ public function gameTimber(){
588589
$p->teleport($this->signlevel->getSpawnLocation());
589590
unset($pl,$p);
590591
}
592+
$this->clearChest();
591593
$this->players=array();
592594
$this->gameStatus=0;
593595
$this->lastTime=0;
@@ -597,6 +599,8 @@ public function gameTimber(){
597599
Server::getInstance()->broadcastMessage(""); // DELETED
598600
$this->gameStatus=0;
599601
$this->lastTime=0;
602+
$this->clearChest();
603+
$this->ClearAllInv();
600604
}
601605
}
602606
if($this->gameStatus==3)
@@ -675,6 +679,7 @@ public function gameTimber(){
675679
$p->setHealth(25);
676680
unset($p,$pl);
677681
}
682+
$this->clearChest();
678683
//$this->ClearAllInv();
679684
$this->players=array();
680685
$this->gameStatus=0;
@@ -1158,6 +1163,7 @@ public function PlayerQuit(PlayerQuitEvent $event){
11581163
if(isset($this->players[$event->getPlayer()->getName()]))
11591164
{
11601165
unset($this->players[$event->getPlayer()->getName()]);
1166+
$this->ClearInv($event->getPlayer());
11611167
$event->getPlayer()->sendMessage(TextFormat::RED. "[{$this->getConfig()->get("prefix")}]".$event->getPlayer()->getName()." left the match.");
11621168
$this->changeStatusSign();
11631169
if($this->gameStatus==1 && count($this->players)<2)

0 commit comments

Comments
 (0)