EntityEffectConditions changed to be inclusive of min/max (#36289)
* soo hungry going back for more lipolicide * too much lipolicide..... * fixes * it moved * typo --------- Co-authored-by: iaada <iaada@users.noreply.github.com>
This commit is contained in:
@@ -13,17 +13,14 @@ public sealed partial class SolutionTemperature : EntityEffectCondition
|
||||
|
||||
[DataField]
|
||||
public float Max = float.PositiveInfinity;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
{
|
||||
if (reagentArgs.Source == null)
|
||||
return false;
|
||||
if (reagentArgs.Source.Temperature < Min)
|
||||
return false;
|
||||
if (reagentArgs.Source.Temperature > Max)
|
||||
return false;
|
||||
return true;
|
||||
return reagentArgs?.Source != null &&
|
||||
reagentArgs.Source.Temperature >= Min &&
|
||||
reagentArgs.Source.Temperature <= Max;
|
||||
}
|
||||
|
||||
// TODO: Someone needs to figure out how to do this for non-reagent effects.
|
||||
|
||||
Reference in New Issue
Block a user