- File transfer improvements (switching the sub selection during transfer works, max transfer duration, waiting for transfers to finish before starting the round)
- Firesource changes (more particles with shorter lifetimes, combining bugfix) - StatusEffects can target hulls and always be active - Cyrillic character support - Saving server settings - Swapping items in inventory by dropping an item to a non-free slot
This commit is contained in:
@@ -273,20 +273,21 @@ namespace Barotrauma
|
||||
if (disableDeltaTime) deltaTime = 1.0f;
|
||||
|
||||
Type type = value.GetType();
|
||||
if (type == typeof(float))
|
||||
if (type == typeof(float) ||
|
||||
(type == typeof(int) && property.GetValue().GetType() == typeof(float)))
|
||||
{
|
||||
float floatValue = (float)value * deltaTime;
|
||||
float floatValue = Convert.ToSingle(value) * deltaTime;
|
||||
|
||||
if (!setValue) floatValue += (float)property.GetValue();
|
||||
property.TrySetValue(floatValue);
|
||||
}
|
||||
else if (type == typeof(int))
|
||||
else if (type == typeof(int) && value.GetType()==typeof(int))
|
||||
{
|
||||
int intValue = (int)((int)value * deltaTime);
|
||||
if (!setValue) intValue += (int)property.GetValue();
|
||||
property.TrySetValue(intValue);
|
||||
}
|
||||
else if (type == typeof(bool))
|
||||
else if (type == typeof(bool) && value.GetType() == typeof(bool))
|
||||
{
|
||||
property.TrySetValue((bool)value);
|
||||
}
|
||||
@@ -294,6 +295,11 @@ namespace Barotrauma
|
||||
{
|
||||
property.TrySetValue((string)value);
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.ThrowError("Couldn't apply value "+value.ToString()+" ("+type+") to property ''"+property.Name+"'' ("+property.GetValue().GetType()+")! "
|
||||
+"Make sure the type of the value set in the config files matches the type of the property.");
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateAll(float deltaTime)
|
||||
|
||||
Reference in New Issue
Block a user