mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
Merge pull request #3072 from alejandroliu/Kill-entity-bug
Fixes bug #3071
This commit is contained in:
commit
ce59703dd0
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -617,7 +617,6 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
|
|
||||||
if($amount <= 0){
|
if($amount <= 0){
|
||||||
if($this->isAlive()){
|
if($this->isAlive()){
|
||||||
$this->health = 0;
|
|
||||||
$this->kill();
|
$this->kill();
|
||||||
}
|
}
|
||||||
}elseif($amount <= $this->getMaxHealth() or $amount < $this->health){
|
}elseif($amount <= $this->getMaxHealth() or $amount < $this->health){
|
||||||
@ -1424,7 +1423,7 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function kill(){
|
public function kill(){
|
||||||
$this->setHealth(0);
|
$this->health = 0;
|
||||||
$this->scheduleUpdate();
|
$this->scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user