mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Add SetCutsceneParentIndex.
This commit is contained in:
parent
b543d9fc1d
commit
5a80e65d3b
5 changed files with 46 additions and 3 deletions
|
|
@ -56,6 +56,24 @@ public sealed class CutsceneService : IService, IDisposable
|
|||
public int GetParentIndex(int idx)
|
||||
=> GetParentIndex((ushort)idx);
|
||||
|
||||
public bool SetParentIndex(int copyIdx, int parentIdx)
|
||||
{
|
||||
if (copyIdx is < CutsceneStartIdx or >= CutsceneEndIdx)
|
||||
return false;
|
||||
|
||||
if (parentIdx is < -1 or >= CutsceneEndIdx)
|
||||
return false;
|
||||
|
||||
if (_objects.GetObjectAddress(copyIdx) == nint.Zero)
|
||||
return false;
|
||||
|
||||
if (parentIdx != -1 && _objects.GetObjectAddress(parentIdx) == nint.Zero)
|
||||
return false;
|
||||
|
||||
_copiedCharacters[copyIdx - CutsceneStartIdx] = (short)parentIdx;
|
||||
return true;
|
||||
}
|
||||
|
||||
public short GetParentIndex(ushort idx)
|
||||
{
|
||||
if (idx is >= CutsceneStartIdx and < CutsceneEndIdx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue