Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix "IsPersistent" and "MarkAsNoLongerNeeded()" using the wrong nativ…
- Loading branch information
|
|
@@ -68,7 +68,17 @@ public int LodDistance |
|
|
public bool IsPersistent |
|
|
{ |
|
|
get => Function.Call<bool>(Hash.IS_ENTITY_A_MISSION_ENTITY, Handle); |
|
|
set => Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, Handle, value, !value); |
|
|
set |
|
|
{ |
|
|
if (value) |
|
|
{ |
|
|
Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, Handle, true, true); |
|
|
} |
|
|
else |
|
|
{ |
|
|
MarkAsNoLongerNeeded(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
public bool FreezePosition |
|
|
@@ -579,7 +589,6 @@ public void ApplyForceRelative(Vector3 direction, Vector3 rotation, ForceType fo |
|
|
public void MarkAsNoLongerNeeded() |
|
|
{ |
|
|
int handle = Handle; |
|
|
Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, handle, false, true); |
|
|
unsafe |
|
|
{ |
|
|
Function.Call(Hash.SET_ENTITY_AS_NO_LONGER_NEEDED, &handle); |
|
|
|
|
|
@@ -116,7 +116,17 @@ public int LodDistance |
|
|
public bool IsPersistent |
|
|
{ |
|
|
get => Function.Call<bool>(Hash.IS_ENTITY_A_MISSION_ENTITY, Handle); |
|
|
set => Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, Handle, value, !value); |
|
|
set |
|
|
{ |
|
|
if (value) |
|
|
{ |
|
|
Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, Handle, true, true); |
|
|
} |
|
|
else |
|
|
{ |
|
|
MarkAsNoLongerNeeded(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
@@ -1197,7 +1207,6 @@ public void ApplyForceRelative(Vector3 direction, Vector3 rotation = default, Fo |
|
|
public void MarkAsNoLongerNeeded() |
|
|
{ |
|
|
int handle = Handle; |
|
|
Function.Call(Hash.SET_ENTITY_AS_MISSION_ENTITY, handle, false, true); |
|
|
unsafe |
|
|
{ |
|
|
Function.Call(Hash.SET_ENTITY_AS_NO_LONGER_NEEDED, &handle); |
|
|
|