Open jdrueckert opened 2 years ago
Theoretically, I would read https://github.com/MovingBlocks/Terasology/blob/8e265d0e08b2c2ee64b391ee7dfbebc1203551c8/engine/src/main/java/org/terasology/engine/logic/characters/ServerCharacterPredictionSystem.java#L97-L103 as "before the component is removed, the entity is added to the characterStatesToRemove
list that will be used in the next update()
to remove all listed entities from the characterStates
map, which is the map that is walked through to find entities whose state needs to be extrapolated in https://github.com/MovingBlocks/Terasology/blob/develop/engine/src/main/java/org/terasology/engine/logic/characters/CharacterMovementSystemUtility.java#L99-L109 .
Practically, if this is true, the only way I could've run into the issue is probably a race condition :thinking:
General Info
Terasology Version: https://jenkins.terasology.io/teraorg/job/Terasology/job/Omega/job/develop/409/ Multiplayer Setup with headless (official) Playtest Server
What you were trying to do
Kill a sheep in MetalRenegades
What actually happened
Server crashed (ran into NPE).
How to reproduce
Log details
Additional Infos / Context
Current assumption: The sheep is theoretically already dead when the
ServerCharacterPredictionSystem
tries to update entities and triggerssetToExtrapolateState
. However, because we're waiting for the dying animation to finish, the entity is still present in thecharacterStates
map and is included in the update. When attempting to accessCharacterMovementComponent
for the extrapolation, the server runs into an NPE because the component has already been removed.