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

I love null checking!! #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 1, 2024

  1. Configuration menu
    Copy the full SHA
    e055b64 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. I love null checking!!

    Fix NRE's from the TowerSelectionMenu_IsUpgradePathClosed patch outside of BTD6Rogue game modes.
    > Weird the code that prevents this was removed in 0.3.0 :/
    
    Use GetTowerFromId(BaseHeroId) instead of GetHeroWithNameAndLevel(BaseHeroId, 1),
    > This fixes RogueHero.GetBaseHero() returning null for modded heros.
    
    Null check the tower returned from RogueTower.GetBaseTower(), RogueHero.GetBaseHero(), RogueParagon.GetBaseTower(). and RogueParagon.GetBaseParagon(), treating that RogueTower as disabled if its tower is null.
    > This fixes cases where the BaseTowerId doesn't reference an existing tower.
    
    Added Warnings if RogueTower/Paragon.GetBaseTower() is in the Hero TowerSet, or if RogueHero.GetBaseHero() is not in the Hero TowerSet.
    > This warns of possible NREs caused by line 25 of TowerSelectionMenu_IsUpgradePathClosed.cs
    (Heros don't reach that line, but normal towers do. RogueTowers likely set a value that RogueHero don't)
    
    Added a Bloon Validation Button which "Validates each RogueBloon to ensure it references existing Bloons in the GameModel. Logs warnings if invalid references are found."  This is unnecessary if no new RogueBloons are being added by external mods.
    > This should be used to catch cases where a RogueBloon doesn't reference an existing bloon, or tries to give a bloon properties it can't spawn with. (like a Camo MOAB or Fortified Blue.)
    Derpy-Jacob-903 committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    9034873 View commit details
    Browse the repository at this point in the history