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

Handle Dungeons with null config #2279

Merged
merged 1 commit into from
Jul 31, 2023
Merged

Handle Dungeons with null config #2279

merged 1 commit into from
Jul 31, 2023

Conversation

scooterboo
Copy link
Contributor

Description

In DungeonExcelConfigData.json, some dungeons have passCond and some do not. passCond are for referencing DungeonPassExcelConfigData.json where there are things such as finish conditions.

Grasscutter null pointer exception'd when a dungeon didn't have passCond.

Issues fixed by this PR

Backstabber water dude's dungeon and battle works!

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

Comment on lines +56 to +62
if(dungeonData.getPassCond() == 0){
this.passConfigData = new DungeonPassConfigData();
this.passConfigData.setConds(new ArrayList<>());
}else {
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
}
this.finishedConditions = new int[this.passConfigData.getConds().size()];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i pray the formatter changes these

@@ -76,6 +81,7 @@ public void triggerEvent(DungeonPassConditionType conditionType, int... params)
}

public boolean isFinishedSuccessfully() {
if(passConfigData.getLogicType()==null) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here lol

@KingRainbow44 KingRainbow44 merged commit 465582b into Grasscutters:development Jul 31, 2023
2 checks passed
@scooterboo scooterboo deleted the patch-1 branch August 4, 2023 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants