Fix parsing floats (#7)

This commit is contained in:
Elle
2017-12-14 19:02:23 +01:00
committed by hondacrx
parent bc7dee3c8d
commit 5fc9082a02
5 changed files with 25 additions and 20 deletions
+5 -4
View File
@@ -21,6 +21,7 @@ using Framework.IO;
using Game.Entities;
using Game.Maps;
using System;
using System.Globalization;
namespace Game.Chat.Commands
{
@@ -284,7 +285,7 @@ namespace Game.Chat.Commands
if (arg_string == "posx")
{
if (!float.TryParse(arg_3, out float arg3))
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
return false;
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_X);
@@ -297,7 +298,7 @@ namespace Game.Chat.Commands
}
else if (arg_string == "posy")
{
if (!float.TryParse(arg_3, out float arg3))
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
return false;
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Y);
@@ -310,7 +311,7 @@ namespace Game.Chat.Commands
}
else if (arg_string == "posz")
{
if (!float.TryParse(arg_3, out float arg3))
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
return false;
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Z);
@@ -323,7 +324,7 @@ namespace Game.Chat.Commands
}
else if (arg_string == "orientation")
{
if (!float.TryParse(arg_3, out float arg3))
if (!float.TryParse(arg_3, NumberStyles.Float, CultureInfo.InvariantCulture, out float arg3))
return false;
stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_O);