mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18: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("->"));
|
||||
}
|
||||
|
||||
for (Entry<String, String> svar : c.getSVars().entrySet()) {
|
||||
String svarName = svar.getKey();
|
||||
String svarValue = svar.getValue();
|
||||
if (!c.hasSVar(sPtr)) {
|
||||
System.out.println("ERROR: Unable to find SVar " + sPtr + " on card " + c + " + to execute!");
|
||||
return;
|
||||
}
|
||||
|
||||
String svarValue = c.getSVar(sPtr);
|
||||
|
||||
if (svarName.equals(sPtr)) {
|
||||
SpellAbility sa = AbilityFactory.getAbility(svarValue, c);
|
||||
sa.setActivatingPlayer(c.getController());
|
||||
if (tgtID != -1) {
|
||||
@@ -396,8 +398,6 @@ public abstract class GameState {
|
||||
}
|
||||
sa.resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user