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

Fixed flares spawning upright

This commit is contained in:
Rich Dunne 2020-08-26 18:35:45 -06:00
parent 773f76a7de
commit 99cb039797

View file

@ -193,15 +193,20 @@ namespace SceneManager
private static void SpawnFlare() private static void SpawnFlare()
{ {
var flare = new Weapon("weapon_flare", shadowBarrier.Position, 1); var flare = new Weapon("weapon_flare", shadowBarrier.Position, 1);
//flare.SetPositionWithSnap(shadowBarrier.Position);
// The purpose of this fiber is to allow the flare to spawn and fall to the ground naturally before freezing its position because you can't spawn it on the ground gracefully (it stands upright) Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(flare, true);
//GameFiber.StartNew(delegate GameFiber.StartNew(() =>
//{ {
// GameFiber.Sleep(1000); while (flare && flare.HeightAboveGround > 0.05f)
// flare.IsPositionFrozen = true; {
// flare.IsCollisionEnabled = false; GameFiber.Yield();
//}); }
GameFiber.Sleep(1000);
if (flare)
{
flare.IsPositionFrozen = true;
}
});
barriers.Add(flare); barriers.Add(flare);
removeBarrierOptions.Enabled = true; removeBarrierOptions.Enabled = true;