Revision: 5199
http://vassalengine.svn.sourceforge.net/vassalengine/?rev=5199&view=rev
Author: swampwallaby
Date: 2009-03-02 20:23:47 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
Bug [2653477] ArrayIndexOutOfBoundsException in Embellishment.getLocalized
Bug [2432256] ArrayIndexOutOfBoundsException in Embellishment
Modified Paths:
--------------
VASSAL-src/branches/swampwallaby-3.1/src/VASSAL/counters/Embellishment.java
Modified: VASSAL-src/branches/swampwallaby-3.1/src/VASSAL/counters/Embellishment.java
===================================================================
--- VASSAL-src/branches/swampwallaby-3.1/src/VASSAL/counters/Embellishment.java 2009-03-02 16:39:17 UTC (rev 5198)
+++ VASSAL-src/branches/swampwallaby-3.1/src/VASSAL/counters/Embellishment.java 2009-03-02 20:23:47 UTC (rev 5199)
@@ -427,9 +427,11 @@
final ArrayList<KeyCommand> l = new ArrayList<KeyCommand>();
final GamePiece outer = Decorator.getOutermost(this);
if (activateCommand.length() > 0 && activateKey.length() > 0) {
- l.add(new KeyCommand(activateCommand,
- KeyStroke.getKeyStroke(activateKey.charAt(0), activateModifiers),
- outer, this));
+ final KeyCommand k = new KeyCommand(activateCommand,
+ KeyStroke.getKeyStroke(activateKey.charAt(0), activateModifiers),
+ outer, this);
+ k.setEnabled(nValues > 0);
+ l.add(k);
}
if (upCommand.length() > 0 &&
upKey.length() > 0 &&
@@ -469,7 +471,7 @@
public Command myKeyEvent(KeyStroke stroke) {
char strokeChar = getMatchingActivationChar(stroke);
ChangeTracker tracker = null;
- if (strokeChar != 0) {
+ if (strokeChar != 0 && nValues > 0) { // Do not Activate if no levels defined
tracker = new ChangeTracker(this);
int index = activationStatus.indexOf(strokeChar);
if (index < 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|