mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 07:30:40 +01:00
Fixed flare spawn
This commit is contained in:
parent
97c6fd91c6
commit
e563612ab0
1 changed files with 57 additions and 34 deletions
|
|
@ -35,17 +35,26 @@ namespace SceneManager.Barriers
|
|||
obj.Delete();
|
||||
}
|
||||
|
||||
_object = new Object(ModelName, Position, Heading);
|
||||
if(!_object)
|
||||
if (ModelName == "0xa2c44e80") // Flare
|
||||
{
|
||||
Game.LogTrivial($"New barrier object is invalid.");
|
||||
return;
|
||||
}
|
||||
var flare = new Weapon("weapon_flare", Position, 1);
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(flare, true);
|
||||
_object = flare;
|
||||
|
||||
GameFiber.StartNew(() =>
|
||||
{
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||
GameFiber.Sleep(1000);
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, false);
|
||||
}, "Spawn Flare Fiber");
|
||||
}
|
||||
else // Any other barrier object
|
||||
{
|
||||
_object = new Object(ModelName, Position, Heading);
|
||||
_object.SetPositionWithSnap(Position);
|
||||
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY<bool>(_object);
|
||||
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||
|
||||
if (Invincible)
|
||||
{
|
||||
Rage.Native.NativeFunction.Natives.SET_DISABLE_FRAG_DAMAGE(_object, true);
|
||||
|
|
@ -61,6 +70,7 @@ namespace SceneManager.Barriers
|
|||
SetAdvancedOptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal Barrier(Object obj, bool invincible, bool immobile, int textureVariation = 0, bool lightsEnabled = false)
|
||||
{
|
||||
|
|
@ -76,12 +86,24 @@ namespace SceneManager.Barriers
|
|||
BarrierManager.PlaceholderBarrier.Delete();
|
||||
}
|
||||
|
||||
_object = new Object(ModelName, Position, Heading);
|
||||
if (ModelName == "0xa2c44e80") // Flare
|
||||
{
|
||||
_object = obj;
|
||||
|
||||
GameFiber.StartNew(() =>
|
||||
{
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||
GameFiber.Sleep(1000);
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, false);
|
||||
}, "Spawn Flare Fiber");
|
||||
}
|
||||
else // Any other barrier object
|
||||
{
|
||||
_object = new Object(ModelName, Position, Heading);
|
||||
_object.SetPositionWithSnap(Position);
|
||||
Rage.Native.NativeFunction.Natives.PLACE_OBJECT_ON_GROUND_PROPERLY<bool>(_object);
|
||||
|
||||
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||
|
||||
if (Invincible)
|
||||
{
|
||||
Rage.Native.NativeFunction.Natives.SET_DISABLE_FRAG_DAMAGE(_object, true);
|
||||
|
|
@ -97,6 +119,7 @@ namespace SceneManager.Barriers
|
|||
SetAdvancedOptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAdvancedOptions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue