Terasology / LightAndShadow

Light & Shadow is an experimental game type set in a quirky Alice in Wonderland inspired setting
Apache License 2.0
8 stars 22 forks source link

Crash when jumping from fool's platform #243

Closed jdrueckert closed 2 years ago

jdrueckert commented 3 years ago

I climbed the side of the fool's platform and jumped off it. When I hit the ground and died due to fall damage, the game crashed with the following NPE:

java.lang.NullPointerException: null
    at org.joml.Vector3f.add(Vector3f.java:608)
    at org.terasology.ligthandshadow.componentsystem.controllers.PlayerDeathSystem.beforeDestroy(PlayerDeathSystem.java:69)
    at org.terasology.ligthandshadow.componentsystem.controllers.PlayerDeathSystemMethodAccess.invoke(Unknown Source)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:379)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl.sendConsumableEvent(EventSystemImpl.java:254)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:233)
    at org.terasology.engine.core.bootstrap.eventSystem.AbstractEventSystemDecorator.send(AbstractEventSystemDecorator.java:67)
    at org.terasology.engine.network.NetworkEventSystemDecorator.send(NetworkEventSystemDecorator.java:54)
    at org.terasology.engine.core.bootstrap.eventSystem.AbstractEventSystemDecorator.send(AbstractEventSystemDecorator.java:67)
    at org.terasology.engine.recording.RecordingEventSystemDecorator.send(RecordingEventSystemDecorator.java:34)
    at org.terasology.engine.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:190)
    at org.terasology.engine.logic.health.EntityDestructionAuthoritySystem.onDestroy(EntityDestructionAuthoritySystem.java:22)
    at org.terasology.engine.logic.health.EntityDestructionAuthoritySystemMethodAccess.invoke(Unknown Source)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl$ByteCodeEventHandlerInfo.invoke(EventSystemImpl.java:379)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl.sendStandardEvent(EventSystemImpl.java:244)
    at org.terasology.engine.entitySystem.event.internal.EventSystemImpl.send(EventSystemImpl.java:235)
    at org.terasology.engine.core.bootstrap.eventSystem.AbstractEventSystemDecorator.send(AbstractEventSystemDecorator.java:67)
    at org.terasology.engine.network.NetworkEventSystemDecorator.send(NetworkEventSystemDecorator.java:54)
    at org.terasology.engine.core.bootstrap.eventSystem.AbstractEventSystemDecorator.send(AbstractEventSystemDecorator.java:67)
    at org.terasology.engine.recording.RecordingEventSystemDecorator.send(RecordingEventSystemDecorator.java:34)
    at org.terasology.engine.entitySystem.entity.internal.BaseEntityRef.send(BaseEntityRef.java:190)
    at org.terasology.module.health.systems.DamageAuthoritySystem.doDamage(DamageAuthoritySystem.java:103)
jdrueckert commented 3 years ago

@ujjman as you're tracking down NPEs at the moment, maybe this would be something for you :wink:

ujjman commented 3 years ago

Actually I found this bug 3 to 4 days back and discussed it on discord. This error also occurs when the player jumps on the fool's platform using hjump or hspeed . I can fix this pretty easily but what happens when the player dies? Should the player respawn to the fool's platform or just start the game from where it died? If the player respawns on the fool's platform, then we need to useCharacterTeleportEvent , which needs to be fixed for LAS

jdrueckert commented 3 years ago

If the player entity has a component that indicates they already belong to the red or black team, then they should spawn on their team's base. If they don't, they should spawn on the fool's platform, I'd say.

jdrueckert commented 2 years ago

Mitigated by #250 and underlying issue fixed by #242