fixes a bunch of warnings
This commit is contained in:
@@ -280,8 +280,7 @@ namespace Content.Server.Botany
|
||||
|
||||
public IEnumerable<EntityUid> AutoHarvest(EntityCoordinates position, int yieldMod = 1)
|
||||
{
|
||||
if (position.IsValid(IoCManager.Resolve<IEntityManager>()) && ProductPrototypes != null &&
|
||||
ProductPrototypes.Count > 0)
|
||||
if (position.IsValid(IoCManager.Resolve<IEntityManager>()) && ProductPrototypes.Count > 0)
|
||||
return GenerateProduct(position, yieldMod);
|
||||
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
@@ -291,10 +290,10 @@ namespace Content.Server.Botany
|
||||
{
|
||||
AddToDatabase();
|
||||
|
||||
if (user == null)
|
||||
if (!user.Valid)
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
|
||||
if (ProductPrototypes == null || ProductPrototypes.Count == 0 || Yield <= 0)
|
||||
if (ProductPrototypes.Count == 0 || Yield <= 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("botany-harvest-fail-message"));
|
||||
return Enumerable.Empty<EntityUid>();
|
||||
@@ -312,14 +311,8 @@ namespace Content.Server.Botany
|
||||
if (yieldMod < 0)
|
||||
{
|
||||
yieldMod = 1;
|
||||
totalYield = Yield;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalYield = Yield * yieldMod;
|
||||
}
|
||||
|
||||
totalYield = Math.Max(1, totalYield);
|
||||
totalYield = Math.Max(1, Yield * yieldMod);
|
||||
}
|
||||
|
||||
var random = IoCManager.Resolve<IRobustRandom>();
|
||||
|
||||
Reference in New Issue
Block a user