From 7bd90af6050e5417a6ec08c154230c85bf29c6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Tue, 23 Nov 2021 20:15:49 +0100 Subject: [PATCH] Fixed AS1/2 - tellTarget when single --- CHANGELOG.md | 1 + .../com/jpexs/decompiler/flash/action/ActionGraph.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58f30688e..017cd742e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. - AS1/2 - call action parameters as string - AS1/2 - gotolabelaction is gotoandplay - AS1/2 - direct editation - use actionadd instead of add2 on swfver < 5 +- AS1/2 - tellTarget when single ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 3a56e8516..855782a94 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -192,13 +192,14 @@ public class ActionGraph extends Graph { int targetStart; int targetEnd; + GraphTargetItem targetStartItem = null; boolean again; do { again = false; targetStart = -1; targetEnd = -1; - GraphTargetItem targetStartItem = null; + targetStartItem = null; GraphTargetItem target = null; for (int t = 0; t < list.size(); t++) { GraphTargetItem it = list.get(t); @@ -245,6 +246,13 @@ public class ActionGraph extends Graph { } } } + + if (targetStart > -1 && targetEnd == -1) { + targetEnd = list.size(); + if (list.get(list.size() - 1) instanceof ScriptEndItem) { + targetEnd--; + } + } if ((targetStart > -1) && (targetEnd > -1) && targetStartItem != null) { List newlist = new ArrayList<>(); for (int i = 0; i < targetStart; i++) {