mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
@PEMapModder Removed redundant parameters for Living::knockBack. Closes #3427.
This commit is contained in:
parent
66b86c3685
commit
9adcc19154
@ -132,7 +132,18 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
$this->attackTime = 10; //0.5 seconds cooldown
|
$this->attackTime = 10; //0.5 seconds cooldown
|
||||||
}
|
}
|
||||||
|
|
||||||
public function knockBack(Entity $attacker, $damage, $x, $z, $base = 0.4){
|
/**
|
||||||
|
* Note: Variadic function is used to preserve BC
|
||||||
|
* @param int $x
|
||||||
|
* @param int $z
|
||||||
|
* @param float $base Default 0.4
|
||||||
|
*/
|
||||||
|
public function knockBack($x, $z, $base = 0.4){
|
||||||
|
if(func_num_args() >= 4){
|
||||||
|
$args = func_get_args();
|
||||||
|
list(, , $x, $z) = $args;
|
||||||
|
$base = isset($args[4]) ? $args[4] : 0.4;
|
||||||
|
}
|
||||||
$f = sqrt($x * $x + $z * $z);
|
$f = sqrt($x * $x + $z * $z);
|
||||||
if($f <= 0){
|
if($f <= 0){
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user