Plants without occupied spaces no longer crash server
This commit is contained in:
parent
c2cb8dd208
commit
934e8f8479
@ -148,6 +148,7 @@ class PlantPieceEntity() : DynamicEntity() {
|
|||||||
piecesInternal.add(Piece(piece))
|
piecesInternal.add(Piece(piece))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allSpaces.isNotEmpty()) {
|
||||||
calculatedMetaBoundingBox = AABB.ofPoints(allSpaces)
|
calculatedMetaBoundingBox = AABB.ofPoints(allSpaces)
|
||||||
|
|
||||||
if (pieces.any { it.isStructuralSegment } && stemSpaces.isNotEmpty()) {
|
if (pieces.any { it.isStructuralSegment } && stemSpaces.isNotEmpty()) {
|
||||||
@ -162,8 +163,11 @@ class PlantPieceEntity() : DynamicEntity() {
|
|||||||
calculatedCollisionBox = calculatedMetaBoundingBox
|
calculatedCollisionBox = calculatedMetaBoundingBox
|
||||||
calculatedCollisionHull = Poly(calculatedMetaBoundingBox)
|
calculatedCollisionHull = Poly(calculatedMetaBoundingBox)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
//calculatedCollisionHull = calculatedCollisionHull * 0.5 + calculatedCollisionHull.aabb.centre * 0.5
|
calculatedMetaBoundingBox = AABB.rectangle(Vector2d.ZERO, 0.1, 0.1)
|
||||||
|
calculatedCollisionBox = calculatedMetaBoundingBox
|
||||||
|
calculatedCollisionHull = Poly(calculatedMetaBoundingBox)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(stream: DataInputStream, isLegacy: Boolean) : this() {
|
constructor(stream: DataInputStream, isLegacy: Boolean) : this() {
|
||||||
|
Loading…
Reference in New Issue
Block a user