Skip to content

Commit

Permalink
fixed actors not being able to be copied between areas
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGameDev committed Apr 11, 2024
1 parent e03a76a commit 0d31815
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Fushigi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

internal class Program
{
public const string Version = "v1.1.5.2";
public const string Version = "v1.1.5.3";

private static void Main(string[] args)
{
Expand Down
4 changes: 2 additions & 2 deletions Fushigi/course/CourseActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static CourseActorType GetActorTypeFromGyaml(string gyaml)
return CourseActorType.None;
}

public CourseActor Clone()
public CourseActor Clone(CourseArea areaTo)
{
CourseActor cloned = new(mPackName, mAreaHash, mLayer)
{
Expand All @@ -293,7 +293,7 @@ public CourseActor Clone()
mRotation = mRotation
};
cloned.mStartingTrans = mStartingTrans;
cloned.mAreaHash = mAreaHash;
cloned.mAreaHash = areaTo.mRootHash;
cloned.mHash = (ulong)(new Random().NextDouble() * ulong.MaxValue);
cloned.mActorParameters = mActorParameters.Clone();
cloned.mSystemParameters = mSystemParameters.Clone();
Expand Down
6 changes: 3 additions & 3 deletions Fushigi/ui/widgets/LevelViewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ public void Draw(Vector2 size, double deltaSeconds, IDictionary<string, bool> la
{
CopiedObjects = new CourseActor[selectedActors.Length];
for (int i = 0; i < CopiedObjects.Length; i++)
CopiedObjects[i] = selectedActors[i].Clone();
CopiedObjects[i] = selectedActors[i].Clone(mArea);
}
bool ctrlOrCtrlShift = (modifiers == KeyboardModifier.CtrlCmd || modifiers == (KeyboardModifier.CtrlCmd | KeyboardModifier.Shift));
bool ctrlAndShift = modifiers == (KeyboardModifier.CtrlCmd | KeyboardModifier.Shift);
Expand All @@ -747,7 +747,7 @@ private void DoImmediatePaste(bool freshCopy)
if (freshCopy)
newActor = new CourseActor(actor.mPackName, actor.mAreaHash, actor.mLayer);
else
newActor = actor.Clone();
newActor = actor.Clone(mArea);
newActor.mStartingTrans = actor.mStartingTrans;
mEditContext.AddActor(newActor);

Expand Down Expand Up @@ -782,7 +782,7 @@ private async Task DoPaste(bool freshCopy)
if (freshCopy)
newActor = new CourseActor(actor.mPackName, actor.mAreaHash, actor.mLayer);
else
newActor = actor.Clone();
newActor = actor.Clone(mArea);

newActor.mTranslation = pos;

Expand Down

0 comments on commit 0d31815

Please sign in to comment.