Tripwire: added missing flag

it's unclear what the purpose of this flag is. It appears to always be set on placement and is never changed at any other time. The result is that the hitbox becomes larger when it is set.
This commit is contained in:
Dylan K. Taylor 2019-02-24 12:19:15 +00:00
parent a3907377f5
commit 832ad0501a

View File

@ -31,16 +31,19 @@ class Tripwire extends Flowable{
/** @var bool */
protected $triggered = false;
/** @var bool */
protected $suspended = false; //unclear usage, makes hitbox bigger if set
/** @var bool */
protected $connected = false;
/** @var bool */
protected $disarmed = false;
protected function writeStateToMeta() : int{
return ($this->triggered ? 0x01 : 0) | ($this->connected ? 0x04 : 0) | ($this->disarmed ? 0x08 : 0);
return ($this->triggered ? 0x01 : 0) | ($this->suspended ? 0x02: 0) | ($this->connected ? 0x04 : 0) | ($this->disarmed ? 0x08 : 0);
}
public function readStateFromData(int $id, int $stateMeta) : void{
$this->triggered = ($stateMeta & 0x01) !== 0;
$this->suspended = ($stateMeta & 0x02) !== 0;
$this->connected = ($stateMeta & 0x04) !== 0;
$this->disarmed = ($stateMeta & 0x08) !== 0;
}