mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-04 23:44:18 +00:00
Fixed AS1/2 - get/setProperty when propertyindex is string
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.action.swf4;
|
||||
|
||||
import com.jpexs.decompiler.flash.BaseLocalData;
|
||||
@@ -29,6 +30,8 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -76,7 +79,15 @@ public class ActionGetProperty extends Action {
|
||||
indexInt = (int) Math.round((Double) value);
|
||||
} else if (value instanceof Float) {
|
||||
indexInt = (int) Math.round((Float) value);
|
||||
} else if (((DirectValueActionItem) index).isString()) {
|
||||
try {
|
||||
indexInt = Integer.parseInt(((DirectValueActionItem) index).toString());
|
||||
} catch (NumberFormatException nfe) {
|
||||
Logger.getLogger(ActionGetProperty.class.getName()).log(Level.SEVERE, "Invalid property index: {0}", index.toString());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger.getLogger(ActionGetProperty.class.getName()).log(Level.SEVERE, "Invalid property index: {0}", index.getClass().getSimpleName());
|
||||
}
|
||||
stack.push(new GetPropertyActionItem(this, lineStartAction, target, indexInt));
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -83,7 +85,15 @@ public class ActionSetProperty extends Action {
|
||||
indexInt = (int) Math.round((Double) ((DirectValueActionItem) index).value);
|
||||
} else if (((DirectValueActionItem) index).value instanceof Float) {
|
||||
indexInt = (int) Math.round((Float) ((DirectValueActionItem) index).value);
|
||||
} else if (((DirectValueActionItem) index).isString()) {
|
||||
try {
|
||||
indexInt = Integer.parseInt(((DirectValueActionItem) index).toString());
|
||||
} catch (NumberFormatException nfe) {
|
||||
Logger.getLogger(ActionGetProperty.class.getName()).log(Level.SEVERE, "Invalid property index: {0}", index.toString());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger.getLogger(ActionGetProperty.class.getName()).log(Level.SEVERE, "Invalid property index: {0}", index.getClass().getSimpleName());
|
||||
}
|
||||
if (value.getThroughDuplicate() instanceof IncrementActionItem) {
|
||||
GraphTargetItem obj = ((IncrementActionItem) value).object;
|
||||
|
||||
Reference in New Issue
Block a user