GetFreeGrid should no longer crash when trying to #wpadd in a zone that has no grids

This commit is contained in:
Natedog2012 2016-02-02 01:53:22 -08:00
parent 43ed5a325f
commit 7efccad13e

View File

@ -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;
}