Workaround for exceptions in SetTransformIgnoreContacts

http://undertowgames.com/forum/viewtopic.php?f=21&t=5915#p112558
This commit is contained in:
Regalis
2017-02-27 20:55:23 +02:00
parent b635a61bb4
commit f8304ceb7e
+12 -1
View File
@@ -598,7 +598,18 @@ namespace Barotrauma
if (contained.body != null)
{
contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f);
try
{
contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f);
}
catch (NullReferenceException e)
{
#if DEBUG
DebugConsole.ThrowError("SetTransformIgnoreContacts threw an exception in SetContainedItemPositions", e);
#endif
contained.body.SetTransform(simPos, 0.0f);
}
}
contained.Rect =