[patch - MapTool b89] setTokenShape bug fix

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Post Reply
User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

[patch - MapTool b89] setTokenShape bug fix

Post by JamzTheMan »

One more for you Az, you can do this one by hand if needed. :)

This patches setTokenShape so that it actually uses the 2nd parameter of tokenID. Currently it defaults to tokenInContext regardless if 2nd parameter is passed or not.
setTokenShape fix

Code: Select all

Index: src/net/rptools/maptool/client/functions/VBL_Functions.java
===================================================================
--- src/net/rptools/maptool/client/functions/VBL_Functions.java	(revision 5944)
+++ src/net/rptools/maptool/client/functions/VBL_Functions.java	(working copy)
@@ -112,7 +112,6 @@
 					throw new ParserException(I18N.getText("macro.function.general.unknownToken", functionName, parameters.get(1).toString()));
 			}
 
-			token = ((MapToolVariableResolver) parser.getVariableResolver()).getTokenInContext();
 			Token.TokenShape newShape = Token.TokenShape.valueOf(parameters.get(0).toString().toUpperCase().trim().replace(" ", "_"));
 			token.setShape(newShape);
 
Attachments
Patch - setTokenShape.txt
(713 Bytes) Downloaded 114 times
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch - MapTool b89] setTokenShape bug fix

Post by Azhrei »

Yes, I found that myself too. :)

I took the original code (which was all "new" stuff and not really bug fixes) and split the get/set functions into their proper source file. I also ended up cleaning up the code a little bit. The current rev 5957 should have all of that included.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: [patch - MapTool b89] setTokenShape bug fix

Post by JamzTheMan »

Cool, I need to create a second instance so I can download everything checked in and not loose my changes. Probably easier given I have to change the SVN URL now as well. :)

And ya, technically a couple of those functions should have been in other classes and not in the VBL class, but was unsure what was going to get committed at the time and it was less invasive that way.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “Testing”