mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Script execution in GameState: do not iterate over all SVars, just grab the necessary SVar directly.
This commit is contained in:
@@ -384,11 +384,13 @@ public abstract class GameState {
|
|||||||
sPtr = sPtr.substring(0, sPtr.indexOf("->"));
|
sPtr = sPtr.substring(0, sPtr.indexOf("->"));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Entry<String, String> svar : c.getSVars().entrySet()) {
|
if (!c.hasSVar(sPtr)) {
|
||||||
String svarName = svar.getKey();
|
System.out.println("ERROR: Unable to find SVar " + sPtr + " on card " + c + " + to execute!");
|
||||||
String svarValue = svar.getValue();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String svarValue = c.getSVar(sPtr);
|
||||||
|
|
||||||
if (svarName.equals(sPtr)) {
|
|
||||||
SpellAbility sa = AbilityFactory.getAbility(svarValue, c);
|
SpellAbility sa = AbilityFactory.getAbility(svarValue, c);
|
||||||
sa.setActivatingPlayer(c.getController());
|
sa.setActivatingPlayer(c.getController());
|
||||||
if (tgtID != -1) {
|
if (tgtID != -1) {
|
||||||
@@ -396,8 +398,6 @@ public abstract class GameState {
|
|||||||
}
|
}
|
||||||
sa.resolve();
|
sa.resolve();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user