Fix Respawn in multiplayer.
ClientEntity.locationComponent.location == PlayerCharacterEntity.locationComponent.location at respawn, now.
@@ -245,12 +245,13 @@ private void respawnPlayer(EntityRef clientEntity) {
LocationComponent location = clientEntity.getComponent(LocationComponent.class);
PlayerFactory playerFactory = new PlayerFactory(entityManager, worldProvider);
Vector3f spawnPosition = playerFactory.findSpawnPositionFromLocationComponent(location);
- location.setWorldPosition(spawnPosition);
- clientEntity.saveComponent(location);
playerCharacter.addComponent(new AliveCharacterComponent());
playerCharacter.send(new CharacterTeleportEvent(spawnPosition));
+ location.setWorldPosition(spawnPosition);
+ clientEntity.saveComponent(location);
+
logger.debug("Re-spawing player at: {}", spawnPosition);
Client clientListener = networkSystem.getOwner(clientEntity);
