Fix parsing floats (#7)
This commit is contained in:
@@ -24,6 +24,7 @@ using Game.Entities;
|
||||
using Game.Maps;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace Game.Chat
|
||||
@@ -129,13 +130,13 @@ namespace Game.Chat
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!float.TryParse(toX, out x))
|
||||
if (!float.TryParse(toX, NumberStyles.Float, CultureInfo.InvariantCulture, out x))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(toY, out y))
|
||||
if (!float.TryParse(toY, NumberStyles.Float, CultureInfo.InvariantCulture, out y))
|
||||
return false;
|
||||
|
||||
if (!float.TryParse(toZ, out z))
|
||||
if (!float.TryParse(toZ, NumberStyles.Float, CultureInfo.InvariantCulture, out z))
|
||||
return false;
|
||||
|
||||
if (!GridDefines.IsValidMapCoord(obj.GetMapId(), x, y, z))
|
||||
@@ -337,19 +338,19 @@ namespace Game.Chat
|
||||
float oz = 0.0f, oy = 0.0f, ox = 0.0f;
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, out oz))
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out oz))
|
||||
return false;
|
||||
|
||||
orientation = args.NextString();
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, out oy))
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out oy))
|
||||
return false;
|
||||
|
||||
orientation = args.NextString();
|
||||
if (!orientation.IsEmpty())
|
||||
{
|
||||
if (!float.TryParse(orientation, out ox))
|
||||
if (!float.TryParse(orientation, NumberStyles.Float, CultureInfo.InvariantCulture, out ox))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user