mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40:29 +01:00
Added check for if shadowBarrier is invalid after creation
This commit is contained in:
parent
080701b0b1
commit
8bbb30e072
1 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Rage;
|
using Rage;
|
||||||
|
|
@ -51,6 +50,10 @@ namespace SceneManager
|
||||||
shadowBarrier.Delete();
|
shadowBarrier.Delete();
|
||||||
|
|
||||||
shadowBarrier = new Rage.Object(Settings.barrierValues[barrierList.Index], TracePlayerView(Settings.BarrierPlacementDistance, TraceFlags.IntersectWorld).HitPosition, rotateBarrier.Value);
|
shadowBarrier = new Rage.Object(Settings.barrierValues[barrierList.Index], TracePlayerView(Settings.BarrierPlacementDistance, TraceFlags.IntersectWorld).HitPosition, rotateBarrier.Value);
|
||||||
|
if (!shadowBarrier)
|
||||||
|
{
|
||||||
|
shadowBarrier = new Rage.Object(Settings.barrierValues[barrierList.Index], TracePlayerView(Settings.BarrierPlacementDistance, TraceFlags.IntersectWorld).HitPosition, rotateBarrier.Value);
|
||||||
|
}
|
||||||
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY(shadowBarrier);
|
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY(shadowBarrier);
|
||||||
shadowBarrier.IsGravityDisabled = true;
|
shadowBarrier.IsGravityDisabled = true;
|
||||||
shadowBarrier.IsCollisionEnabled = false;
|
shadowBarrier.IsCollisionEnabled = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue