Skip to content

Commit 2bdcb9d

Browse files
committed
Fixed how tile property "DR_Color" is parsed
1 parent 6610e20 commit 2bdcb9d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

DynamicReflections/Framework/Managers/TileManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ private ReflectableMapTile GetReflectableMapTile(Layer layer, int x, int y)
175175
}
176176
}
177177

178-
if (tile.Properties.TryGetValue("DR_Color", out string color) && string.IsNullOrEmpty(color) is false && color.Split(' ').Length >= 3 is true)
178+
if (tile.Properties.TryGetValue("DR_Color", out string color) && string.IsNullOrEmpty(color) is false && color.Split(' ').Length >= 4 is true)
179179
{
180180
var splitColorValues = color.Split(' ');
181181

182182
bool isValidColor = true;
183-
for (int i = 0; i < 3; i++)
183+
for (int i = 0; i < 4; i++)
184184
{
185-
if (float.TryParse(splitColorValues[i], out float _) is false)
185+
if (int.TryParse(splitColorValues[i], out int _) is false)
186186
{
187187
isValidColor = false;
188188
break;
@@ -192,7 +192,7 @@ private ReflectableMapTile GetReflectableMapTile(Layer layer, int x, int y)
192192
if ( (isValidColor))
193193
{
194194
{
195-
reflectableMapTile.ReflectionColor = new Color(float.Parse(splitColorValues[0]), float.Parse(splitColorValues[1]), float.Parse(splitColorValues[2]), float.Parse(splitColorValues[3]));
195+
reflectableMapTile.ReflectionColor = new Color(int.Parse(splitColorValues[0]), int.Parse(splitColorValues[1]), int.Parse(splitColorValues[2]), int.Parse(splitColorValues[3]));
196196
}
197197
}
198198
}

0 commit comments

Comments
 (0)