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,30 +35,40 @@ namespace SceneManager.Barriers
|
||||||
obj.Delete();
|
obj.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
_object = new Object(ModelName, Position, Heading);
|
if (ModelName == "0xa2c44e80") // Flare
|
||||||
if(!_object)
|
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"New barrier object is invalid.");
|
var flare = new Weapon("weapon_flare", Position, 1);
|
||||||
return;
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(flare, true);
|
||||||
}
|
_object = flare;
|
||||||
|
|
||||||
_object.SetPositionWithSnap(Position);
|
GameFiber.StartNew(() =>
|
||||||
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);
|
|
||||||
if (ModelName != "prop_barrier_wat_03a")
|
|
||||||
{
|
{
|
||||||
Rage.Native.NativeFunction.Natives.SET_DISABLE_BREAKING(_object, true);
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||||
}
|
GameFiber.Sleep(1000);
|
||||||
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, false);
|
||||||
|
}, "Spawn Flare Fiber");
|
||||||
}
|
}
|
||||||
_object.IsPositionFrozen = Immobile;
|
else // Any other barrier object
|
||||||
|
|
||||||
if (Settings.EnableAdvancedBarricadeOptions)
|
|
||||||
{
|
{
|
||||||
SetAdvancedOptions();
|
_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);
|
||||||
|
if (ModelName != "prop_barrier_wat_03a")
|
||||||
|
{
|
||||||
|
Rage.Native.NativeFunction.Natives.SET_DISABLE_BREAKING(_object, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_object.IsPositionFrozen = Immobile;
|
||||||
|
|
||||||
|
if (Settings.EnableAdvancedBarricadeOptions)
|
||||||
|
{
|
||||||
|
SetAdvancedOptions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,25 +86,38 @@ namespace SceneManager.Barriers
|
||||||
BarrierManager.PlaceholderBarrier.Delete();
|
BarrierManager.PlaceholderBarrier.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
_object = new Object(ModelName, Position, Heading);
|
if (ModelName == "0xa2c44e80") // Flare
|
||||||
|
|
||||||
_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);
|
_object = obj;
|
||||||
if (ModelName != "prop_barrier_wat_03a")
|
|
||||||
|
GameFiber.StartNew(() =>
|
||||||
{
|
{
|
||||||
Rage.Native.NativeFunction.Natives.SET_DISABLE_BREAKING(_object, true);
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, true);
|
||||||
}
|
GameFiber.Sleep(1000);
|
||||||
|
Rage.Native.NativeFunction.Natives.SET_ENTITY_DYNAMIC(_object, false);
|
||||||
|
}, "Spawn Flare Fiber");
|
||||||
}
|
}
|
||||||
_object.IsPositionFrozen = Immobile;
|
else // Any other barrier object
|
||||||
|
|
||||||
if (Settings.EnableAdvancedBarricadeOptions)
|
|
||||||
{
|
{
|
||||||
SetAdvancedOptions();
|
_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);
|
||||||
|
if (ModelName != "prop_barrier_wat_03a")
|
||||||
|
{
|
||||||
|
Rage.Native.NativeFunction.Natives.SET_DISABLE_BREAKING(_object, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_object.IsPositionFrozen = Immobile;
|
||||||
|
|
||||||
|
if (Settings.EnableAdvancedBarricadeOptions)
|
||||||
|
{
|
||||||
|
SetAdvancedOptions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue