Files
tbd-station-14/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs
Pieter-Jan Briers f182ff5613 Remove CannyFastMath.
2020-08-12 21:19:34 +02:00

23 lines
766 B
C#

using System;
using Content.Shared.GameObjects.Components.Inventory;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects
{
[RegisterComponent]
public class HeatResistanceComponent : Component
{
public override string Name => "HeatResistance";
public int GetHeatResistance()
{
if (Owner.GetComponent<InventoryComponent>().TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, itemComponent: out ClothingComponent gloves)
| Owner.TryGetComponent(out SpeciesComponent speciesComponent))
{
return Math.Max(gloves?.HeatResistance ?? int.MinValue, speciesComponent?.HeatResistance ?? int.MinValue);
}
return int.MinValue;
}
}
}