1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-10 15:20:29 +01:00

Added null check to barrier creation

This commit is contained in:
Rich Dunne 2021-05-23 08:28:16 -06:00
parent e7be1dc820
commit 132b89dd25

View file

@ -36,6 +36,11 @@ namespace SceneManager.Barriers
}
_object = new Object(ModelName, Position, Heading);
if(!_object)
{
Game.LogTrivial($"New barrier object is invalid.");
return;
}
_object.SetPositionWithSnap(Position);
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY<bool>(_object);