mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +00:00
Revert "JoinLeaveSingularity: also cancel task if transform sync or player body gets destroyed"
This reverts commit e125258fdeb7da74eaa92917871b2ee2cfc99dcd.
This commit is contained in:
parent
e125258fde
commit
67f390a7ef
@ -19,7 +19,7 @@ public static class JoinLeaveSingularity
|
|||||||
if (joining)
|
if (joining)
|
||||||
{
|
{
|
||||||
if (PlayerTransformSync.LocalInstance == null ||
|
if (PlayerTransformSync.LocalInstance == null ||
|
||||||
player.PlayerId < QSBPlayerManager.LocalPlayerId)
|
player.PlayerId < QSBPlayerManager.LocalPlayerId)
|
||||||
{
|
{
|
||||||
// player was here before we joined
|
// player was here before we joined
|
||||||
return;
|
return;
|
||||||
@ -34,11 +34,7 @@ public static class JoinLeaveSingularity
|
|||||||
}
|
}
|
||||||
|
|
||||||
var go = new GameObject($"player {player} JoinLeaveSingularity");
|
var go = new GameObject($"player {player} JoinLeaveSingularity");
|
||||||
var ct = CancellationTokenSource.CreateLinkedTokenSource(
|
var ct = go.GetCancellationTokenOnDestroy();
|
||||||
go.GetCancellationTokenOnDestroy(),
|
|
||||||
player.TransformSync.GetCancellationTokenOnDestroy(),
|
|
||||||
player.Body.GetCancellationTokenOnDestroy()
|
|
||||||
).Token;
|
|
||||||
UniTask.Create(async () =>
|
UniTask.Create(async () =>
|
||||||
{
|
{
|
||||||
DebugLog.DebugWrite($"{go.name}: WARP TASK");
|
DebugLog.DebugWrite($"{go.name}: WARP TASK");
|
||||||
@ -146,4 +142,4 @@ public static class JoinLeaveSingularity
|
|||||||
};
|
};
|
||||||
await UniTask.WaitUntil(() => !effect.enabled && !singularity._owOneShotSource.isPlaying, cancellationToken: ct);
|
await UniTask.WaitUntil(() => !effect.enabled && !singularity._owOneShotSource.isPlaying, cancellationToken: ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user