fix: Fixes plants crashing on older clients (#1243)

This commit is contained in:
Kamron Batman 2022-11-11 22:49:03 -08:00 committed by GitHub
parent ed8f2438fd
commit d494a9c78c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 55 deletions

View file

@ -315,25 +315,14 @@ namespace Server.Engines.Plants
m_LeftResources = 8;
}
public int GetLocalizedDirtStatus()
{
if (Water <= 1)
public int GetLocalizedDirtStatus() =>
Water switch
{
return 1060826; // hard
}
if (Water <= 2)
{
return 1060827; // soft
}
if (Water <= 3)
{
return 1060828; // squishy
}
return 1060829; // sopping wet
}
<= 1 => 1060826, // hard
<= 2 => 1060827, // soft
<= 3 => 1060828, // squishy
_ => 1060829 // sappy wet
};
public int GetLocalizedHealth()
{
@ -342,7 +331,7 @@ namespace Server.Engines.Plants
PlantHealth.Dying => 1060825, // dying
PlantHealth.Wilted => 1060824, // wilted
PlantHealth.Healthy => 1060823, // healthy
_ => 1060822
_ => 1060822 // vibrant
};
}