From 293b5f80300b5c791892ed4b270bd3866bf51b3a Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Fri, 4 Jun 2010 17:39:21 +0000 Subject: [PATCH] Try guarding against rogue map coordinate values. git-svn-id: https://radegast.googlecode.com/svn/trunk@681 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- Radegast/GUI/Consoles/MapConsole.cs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Radegast/GUI/Consoles/MapConsole.cs b/Radegast/GUI/Consoles/MapConsole.cs index 0999d60..4d281d3 100644 --- a/Radegast/GUI/Consoles/MapConsole.cs +++ b/Radegast/GUI/Consoles/MapConsole.cs @@ -219,9 +219,18 @@ namespace Radegast public void DisplayLocation(string region, int x, int y, int z) { txtRegion.Text = region; - nudX.Value = x; - nudY.Value = y; - nudZ.Value = z; + + try + { + nudX.Value = x; + nudY.Value = y; + nudZ.Value = z; + } + catch (Exception ex) + { + Logger.Log("Failed setting map position controls: ", Helpers.LogLevel.Warning, instance.Client, ex); + } + gotoRegion(txtRegion.Text, x, y); btnTeleport.Enabled = true; btnTeleport.Focus(); @@ -336,9 +345,16 @@ namespace Radegast if (m.Groups.Count > 3) { txtRegion.Text = m.Groups[2].Value; - nudX.Value = int.Parse(m.Groups[3].Value); - nudY.Value = int.Parse(m.Groups[4].Value); - nudZ.Value = 0; + try + { + nudX.Value = int.Parse(m.Groups[3].Value); + nudY.Value = int.Parse(m.Groups[4].Value); + nudZ.Value = 0; + } + catch (Exception ex) + { + Logger.Log("Failed setting map position controls: ", Helpers.LogLevel.Warning, instance.Client, ex); + } if (m.Groups.Count > 5 && m.Groups[6].Value != String.Empty) { -- 2.11.0