mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Restrict XpSeed to the bounds of an int32, close #1040
This commit is contained in:
parent
7870a8672e
commit
cd66f58526
@ -357,7 +357,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
}
|
||||
|
||||
if(!isset($this->namedtag->XpSeed) or !($this->namedtag->XpSeed instanceof IntTag)){
|
||||
$this->namedtag->XpSeed = new IntTag("XpSeed", $this->xpSeed ?? ($this->xpSeed = mt_rand(PHP_INT_MIN, PHP_INT_MAX)));
|
||||
$this->namedtag->XpSeed = new IntTag("XpSeed", $this->xpSeed ?? ($this->xpSeed = mt_rand(-0x80000000, 0x7fffffff)));
|
||||
}else{
|
||||
$this->xpSeed = $this->namedtag["XpSeed"];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user