Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: metamacro functions producing Java errors #4582

Closed
bubblobill opened this issue Dec 24, 2023 · 4 comments · Fixed by #4583 or #4605
Closed

[Bug]: metamacro functions producing Java errors #4582

bubblobill opened this issue Dec 24, 2023 · 4 comments · Fixed by #4583 or #4605
Assignees
Labels

Comments

@bubblobill
Copy link
Collaborator

Describe the Bug

image
https://discord.com/channels/296230822262865920/905157521193455676/1188456999755714610

To Reproduce

use metamacro function without all optional parameters

Expected Behaviour

should function cleanly

Screenshots

No response

MapTool Info

No response

Desktop

No response

Additional Context

No response

@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented Jan 2, 2024

This change has broken all the functions it touches. E.g., getMacros() went from

      if (parameters.get(1).toString().equalsIgnoreCase("campaign")) {
        return getMacros(delim, MapTool.getCampaign().getMacroButtonPropertiesArray());
      } else if (parameters.get(1).toString().equalsIgnoreCase("gm")) {
        return getMacros(delim, MapTool.getCampaign().getGmMacroButtonPropertiesArray());
      } else {
        Token token = FunctionUtil.getTokenFromParam(resolver, functionName, parameters, 1, 2);
        return getMacros(delim, token);
      }

to

      if (parameters.size() > 1) {
        if (parameters.get(1).toString().equalsIgnoreCase("campaign")) {
          return getMacros(delim, MapTool.getCampaign().getMacroButtonPropertiesArray());
        } else if (parameters.get(1).toString().equalsIgnoreCase("gm")) {
          return getMacros(delim, MapTool.getCampaign().getGmMacroButtonPropertiesArray());
        }
      } else {
        Token token = FunctionUtil.getTokenFromParam(resolver, functionName, parameters, 1, 2);
        return getMacros(delim, token);
      }

So there is now no way to use this function with parameters, unless we happen to use the new "campaign" or "gm" options.

@bubblobill
Copy link
Collaborator Author

bubblobill commented Jan 2, 2024

This change broken all the functions it touches. E.g., getMacros() went from

So there is now no way to use this function with parameters, unless we happen to use the new "campaign" or "gm" options.

Hmmm... that could be problematic. Just a little bit. That being said, it will only break every framework known to man,

@bubblobill
Copy link
Collaborator Author

Fixed the fix. Properly this time. Complete with lots of testing to prevent future embarrassment

@github-project-automation github-project-automation bot moved this from In Progress to Done in MapTool Release 1.15.0 Jan 2, 2024
@kwvanderlinde
Copy link
Collaborator

Awesome, looks good now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
2 participants