Fixed #1595 Undefined variable on QueryHandler

This commit is contained in:
Shoghi Cervantes 2014-07-10 13:15:24 +02:00
parent d3789d4fed
commit e6c510e7fd
2 changed files with 3 additions and 6 deletions

View File

@ -67,11 +67,8 @@ abstract class Living extends Entity implements Damageable{
$motion = new Vector3(0, 0.25, 0);
if($source instanceof EntityDamageByEntityEvent){
$e = $source->getDamager();
$deltaX = $this->x - $e->x;
$deltaZ = $this->z - $e->z;
$yaw = atan2($deltaX, $deltaZ);
$motion->x = sin($yaw) * 0.5;
$motion->z = cos($yaw) * 0.5;
$motion->x = -cos(deg2rad($e->pitch)) * sin(deg2rad($e->yaw)) * 0.5;
$motion->z = cos(deg2rad($e->pitch)) * sin(deg2rad($e->yaw)) * 0.5;
}
$this->setMotion($motion);
$this->setHealth($this->getHealth() - $damage);

View File

@ -122,7 +122,7 @@ class QueryHandler{
break;
case self::STATISTICS: //Stat
$token = Binary::readInt(substr($payload, 0, 4));
if($token !== self::getTokenString($this->token, $address) and $token !== self::getTokenString($this->lastToken, $ip)){
if($token !== self::getTokenString($this->token, $address) and $token !== self::getTokenString($this->lastToken, $address)){
break;
}
$reply = chr(self::STATISTICS);