diff --git a/ObjectSync.cs b/ObjectSync.cs index 42a2a57..6e23d6d 100644 --- a/ObjectSync.cs +++ b/ObjectSync.cs @@ -306,7 +306,7 @@ namespace MSCO public void ApplyAvatarHold(int playerId, int bodyId, Vector3 pos, Quaternion rot) { SyncedBody b; - if (!byId.TryGetValue(bodyId, out b) || b.Rb == null) return; + if (!byId.TryGetValue(bodyId, out b) || b.Rb == null || b.IsVehicle) return; // ältere Mods melden evtl. ein Auto als "gehalten" if (b.OwnerId != playerId) { if (!Wins(playerId, true, b.OwnerId, b.OwnerActive)) return; @@ -534,7 +534,9 @@ namespace MSCO { Rigidbody rb = t.GetComponent(); SyncedBody b; - if (rb != null && byRb.TryGetValue(rb, out b)) return IsReallyInHand(b) ? b : null; + // Fahrzeuge hält man nie in der Hand: im Auto zeigt PickedObject z.B. aufs Lenkrad, dessen + // Physik-Körper ist das Auto selbst - das Auto würde sonst mit dem Kopf mitkippen + if (rb != null && byRb.TryGetValue(rb, out b)) return !b.IsVehicle && IsReallyInHand(b) ? b : null; } return null; }