Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions ValheimPlus/Utility/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,11 @@ public static float tFloat(this float value, int digits)

public static float applyModifierValue(float targetValue, float value)
{

// cap negative modifiers at -100%
if (value <= -100)
value = -100;

float newValue = targetValue;

if (value >= 0)
{
newValue = targetValue + ((targetValue / 100) * value);
}
else
{
newValue = targetValue - ((targetValue / 100) * (value * -1));
}

return newValue;
return targetValue * (1 + value / 100);
}

public static Texture2D LoadPng(Stream fileStream)
Expand Down