Possible fix for #323

This commit is contained in:
Shoghi Cervantes 2013-06-04 17:42:32 +02:00
parent dce9b3140a
commit f12620f376
2 changed files with 8 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class Vector3{
public function __construct($x = 0, $y = 0, $z = 0){ public function __construct($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){ if(($x instanceof Vector3) === true){
Vector3::__construct($x->x, $x->y, $x->z); $this->__construct($x->x, $x->y, $x->z);
}else{ }else{
$this->x = $x; $this->x = $x;
$this->y = $y; $this->y = $y;

View File

@ -29,7 +29,13 @@ class Position extends Vector3{
public $level; public $level;
public function __construct($x = 0, $y = 0, $z = 0, Level $level){ public function __construct($x = 0, $y = 0, $z = 0, Level $level){
parent::__construct($x, $y, $z); if(($x instanceof Vector3) === true){
$this->__construct($x->x, $x->y, $x->z, $level);
}else{
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
$this->level = $level; $this->level = $level;
} }