Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 06-24-2015, 02:39 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Looks like it's trying to translate a NULL result to an int on the "freeGridID = atoi(row[0]) + 1;" line:

https://github.com/EQEmu/Server/blob...ints.cpp#L1208

Code:
uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) {

	std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid);
	auto results = QueryDatabase(query);
	if (!results.Success()) {
		return 0;
	}

	if (results.RowCount() != 1)
		return 0;

	auto row = results.begin();
	uint32 freeGridID = 1;
	freeGridID = atoi(row[0]) + 1;

	return freeGridID;
}
This query would return a NULL only if there are no grid entries for the specified zone in the database at all.

It looks like the code should be updated to check for NULL in row[0], and return 0 if it finds it.

A workaround would be to manually add a dummy grid entry to the table for that zone. Something like:

Code:
INSERT INTO `grid_entries` VALUES (0, <<YourZoneID>>, 0, 0.0, 0.0, 0.0, 0, 0);
Replace <<YourZoneID>> with the id of whatever the zone you're seeing the crash in.

That would at least return a 0 to the function in the meantime, instead of a NULL.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:53 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3