DarkestHour icon indicating copy to clipboard operation
DarkestHour copied to clipboard

Artillery becomes "Unavailable" on maps if the DH_ArtilleryLegacy limit is <1

Open GDrukenmiller opened this issue 2 years ago • 1 comments

DH_ArtilleryLegacy checks and requires the limit value to be >0 for artillery to be available on a map. This breaks artillery on maps that functioned prior to the 10.0 update and is unnecessary behavior as the actual artillery limit is taken from settings in the ROLevelInfo.

This check could just be removed, as it does not appear to serve any purpose.

GDrukenmiller avatar Oct 21 '21 05:10 GDrukenmiller

@GDrukenmiller which check exactly? could you point to the line in the code Do you mean these lines in https://github.com/DarklightGames/DarkestHour/blob/6e75e5aaded3687fd1e5c92b1f82acb2fb95d258/DH_Engine/Classes/DarkestHourGame.uc#L2406 ?

    // Check if off-map artillery (legacy artillery) is enabled
    for (i = 0; i < DHLevelInfo.ArtilleryTypes.Length; ++i)
    {
        if (DHLevelInfo.ArtilleryTypes[i].TeamIndex == NEUTRAL_TEAM_INDEX)
        {
            GRI.bOffMapArtilleryEnabled[AXIS_TEAM_INDEX] = 1;
            GRI.bOffMapArtilleryEnabled[ALLIES_TEAM_INDEX] = 1;
        }
        else if (DHLevelInfo.ArtilleryTypes[DHLevelInfo.ArtilleryTypes[i].TeamIndex].Limit > 0)
        {
            GRI.bOffMapArtilleryEnabled[DHLevelInfo.ArtilleryTypes[i].TeamIndex] = 1;
        }
    }
}

Also, could you give examples of maps that use only ROLevelInfo for artillery and on which the artillery availability is broken because of that in order to reproduce the bug?

mimiski avatar Oct 21 '21 16:10 mimiski