This commit is contained in:
Aleksander Waage 2020-08-23 13:56:58 +02:00
parent ed38e19266
commit 01c8eabce7
2 changed files with 9 additions and 9 deletions

View File

@ -114,20 +114,20 @@ namespace QSB.DeathSync
{
// Reset player position.
var playerBody = Locator.GetPlayerBody();
playerBody?.WarpToPositionRotation(_playerSpawnPoint.transform.position, _playerSpawnPoint.transform.rotation);
playerBody?.SetVelocity(_playerSpawnPoint.GetPointVelocity());
_playerSpawnPoint?.AddObjectToTriggerVolumes(Locator.GetPlayerDetector().gameObject);
_playerSpawnPoint?.AddObjectToTriggerVolumes(_fluidDetector.gameObject);
_playerSpawnPoint?.OnSpawnPlayer();
playerBody.WarpToPositionRotation(_playerSpawnPoint.transform.position, _playerSpawnPoint.transform.rotation);
playerBody.SetVelocity(_playerSpawnPoint.GetPointVelocity());
_playerSpawnPoint.AddObjectToTriggerVolumes(Locator.GetPlayerDetector().gameObject);
_playerSpawnPoint.AddObjectToTriggerVolumes(_fluidDetector.gameObject);
_playerSpawnPoint.OnSpawnPlayer();
// Stop suffocation sound effect.
_playerResources?.SetValue("_isSuffocating", false);
_playerResources.SetValue("_isSuffocating", false);
// Reset player health and resources.
_playerResources?.DebugRefillResources();
_playerResources.DebugRefillResources();
// Remove space suit.
_spaceSuit?.RemoveSuit(true);
_spaceSuit.RemoveSuit(true);
}
private SpawnPoint GetSpawnPoint(bool isShip = false)

View File

@ -32,7 +32,7 @@ namespace QSB.Messaging
if (NetworkServer.handlers.Keys.Contains((short)_eventType))
{
DebugLog.LogState($"{_eventType} HANDLER", false);
DebugLog.ToConsole($"Warning - NetworkServer already contains a handler for EventType {_eventType} : You probably used the wrong type in an event.", MessageType.Warning);
DebugLog.ToConsole($"Warning - NetworkServer already contains a handler for EventType {_eventType}", MessageType.Warning);
NetworkServer.handlers.Remove((short)_eventType);
}
NetworkServer.RegisterHandler((short)_eventType, OnServerReceiveMessageHandler);