check if frame is already detached before detaching it - this also fixes a bug on client when he was trying to detach already detached frame

This commit is contained in:
in0finite 2020-07-04 20:12:01 +02:00
parent 9c63b25d38
commit 942453a2a4

View file

@ -231,6 +231,9 @@ namespace SanAndreasUnity.Behaviours.Vehicles
void DetachFrameDuringExplosion(Frame frame, float mass, GameObject parentGo)
{
if (! this.transform.IsParentOf(frame.transform)) // already detached ?
return;
var meshFilter = frame.GetComponentInChildren<MeshFilter>();
if (null == meshFilter)
return;