Passenger: player colliders off while riding (they pushed seats/parts out, physics crashed); last position: not overwritten by the save's start point, invalid positions ignored, saved when a player leaves
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -157,10 +157,10 @@ public sealed class WorldState
|
||||
public void ApplyPlayer(string steamId, byte[] payload)
|
||||
{
|
||||
if (string.IsNullOrEmpty(steamId) || payload.Length < 12) return;
|
||||
PlayerPositions[steamId] = new[]
|
||||
{
|
||||
BitConverter.ToSingle(payload, 0), BitConverter.ToSingle(payload, 4), BitConverter.ToSingle(payload, 8)
|
||||
};
|
||||
var pos = new[] { BitConverter.ToSingle(payload, 0), BitConverter.ToSingle(payload, 4), BitConverter.ToSingle(payload, 8) };
|
||||
// Unsinnige Positionen (z.B. mit einem explodierten Auto weggeschleudert) nicht speichern
|
||||
if (!IsValidPose(pos, new float[] { 0, 0, 0, 1 })) return;
|
||||
PlayerPositions[steamId] = pos;
|
||||
Dirty = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user