Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.82k stars 259 forks source link

Add code analyzers to detect Stardew Valley 1.3 issues #471

Closed Pathoschild closed 6 years ago

Pathoschild commented 6 years ago

Stardew Valley 1.3 introduces some gotchas for mods. In particular, net fields (like NetInt) handle implicit conversions in a way that's likely to cause mod bugs. For example, item?.category == null && item?.category != null can both be true at once, and building.indoors != null will be true for a null value in some cases.

Add C# analyzers to the mod build config package so modders see warnings in Visual Studio for problematic code.

Pathoschild commented 6 years ago

Done in develop for the upcoming SMAPI 2.6 release.