Fixes bad expressions, bad bool checks in loops, a few null pointer exceptions, and optimizes constructors.

This commit is contained in:
Kamron Batman 2018-09-15 23:16:45 -07:00
parent 8da55d6043
commit f93c3b992e
62 changed files with 318 additions and 634 deletions

View file

@ -152,10 +152,10 @@ namespace Server.Engines.Plants
if (firstPrimary && secondPrimary)
return notBrightFirst | notBrightSecond;
if (firstPrimary && !secondPrimary)
if (firstPrimary)
return notBrightFirst;
if (!firstPrimary && secondPrimary)
if (secondPrimary)
return notBrightSecond;
return notBrightFirst & notBrightSecond;

View file

@ -125,15 +125,8 @@ namespace Server.Engines.Plants
private int m_SeedLabelPlural;
private PlantTypeInfo(int itemID, int offsetX, int offsetY, PlantType plantType, bool containsPlant, bool flowery,
bool crossable, bool reproduces, PlantCategory plantCategory)
: this(itemID, offsetX, offsetY, plantType, containsPlant, flowery, crossable, reproduces, plantCategory, -1, -1,
-1, -1, -1, -1)
{
}
private PlantTypeInfo(int itemID, int offsetX, int offsetY, PlantType plantType, bool containsPlant, bool flowery,
bool crossable, bool reproduces, PlantCategory plantCategory, int plantLabelSeed, int plantLabelPlant,
int plantLabelFullGrown, int plantLabelDecorative, int seedLabel, int seedLabelPlural)
bool crossable, bool reproduces, PlantCategory plantCategory, int plantLabelSeed = -1, int plantLabelPlant = -1,
int plantLabelFullGrown = -1, int plantLabelDecorative = -1, int seedLabel = -1, int seedLabelPlural = -1)
{
ItemID = itemID;
OffsetX = offsetX;