From 7efccad13e0a5f3c5f9ffe5450ddf4bd53f5f93d Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 2 Feb 2016 01:53:22 -0800 Subject: [PATCH] GetFreeGrid should no longer crash when trying to #wpadd in a zone that has no grids --- zone/waypoints.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 5ab46dc1f..51a7af4fb 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1186,8 +1186,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { return 0; auto row = results.begin(); - uint32 freeGridID = 1; - freeGridID = atoi(row[0]) + 1; + uint32 freeGridID = row[0] ? atoi(row[0]) + 1 : 1; return freeGridID; }