mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-24 04:14:07 +00:00
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:
parent
a3907377f5
commit
832ad0501a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user