hitbox error message handling
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
9958a6c5d4
commit
d7e20f0970
@ -24,6 +24,7 @@ import electrosphere.entity.EntityDataStrings;
|
||||
import electrosphere.entity.EntityUtils;
|
||||
import electrosphere.entity.state.hitbox.HitboxCollectionState.HitboxState.HitboxShapeType;
|
||||
import electrosphere.game.data.collidable.HitboxData;
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.util.math.MathUtils;
|
||||
|
||||
/**
|
||||
@ -365,9 +366,23 @@ public class HitboxCollectionState {
|
||||
|
||||
//create new capsule
|
||||
length = previousWorldPos.distance(worldPosition) / 2.0;
|
||||
if(length > 5000 || Double.isNaN(length) || Double.isInfinite(length) || length <= 0){
|
||||
if(length > 5000 || Double.isNaN(length) || Double.isInfinite(length) || length < 0){
|
||||
if(length < 0){
|
||||
LoggerInterface.loggerEngine.WARNING("Length is too short! " + length);
|
||||
}
|
||||
if(length > 5000){
|
||||
LoggerInterface.loggerEngine.WARNING("Length is too long! " + length);
|
||||
}
|
||||
if(Double.isNaN(length) || Double.isInfinite(length)){
|
||||
LoggerInterface.loggerEngine.WARNING("Length is invalid number! " + length);
|
||||
}
|
||||
if(Double.isNaN(previousWorldPos.x) || Double.isInfinite(previousWorldPos.x)){
|
||||
LoggerInterface.loggerEngine.WARNING("Previous hitbox position isn't valid!");
|
||||
}
|
||||
if(Double.isNaN(worldPosition.x) || Double.isInfinite(worldPosition.x)){
|
||||
LoggerInterface.loggerEngine.WARNING("Current hitbox position isn't valid!");
|
||||
}
|
||||
length = 0.1;
|
||||
System.out.println("HitboxState --- THIS IS NAN WHEN YOU SPAWN A KATANA BECAUSE THE BONE POSITION IS NAN???");
|
||||
}
|
||||
geom = CollisionBodyCreation.createCapsuleShape(manager.getCollisionEngine(), shapeStatus.getHitboxData().getRadius(), length, Collidable.TYPE_OBJECT_BIT);
|
||||
CollisionBodyCreation.attachGeomToBody(collisionEngine,body,geom);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user