Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::General > Archive::News

Archive::News Archive area for New's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #29  
Old 11-14-2002, 03:18 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Found the bug....

This is in loottables.cpp

if (RunQuery(query, MakeAnyLenString(&query, "SELECT lootdrop_id, item_id, item_charges, equip_item, chance FROM lootdrop_entries WHERE lootdrop_id=%i", lootdrop_id), errbuf, &result))
{
delete[] query;
while (row = mysql_fetch_row(result))
{
if(rand() * 100 < atoi(row[4]) < 10 ? 10 : atoi(row[4]))
{
int32 itemid = atoi(row[1]);
const Item_Struct* dbitem = database.GetItem(itemid);
if (dbitem == 0)
{
cerr << "Error in AddLootDropToNPC: dbitem=0, item#=" << itemid << ", lootdrop_id=" << lootdrop_id << endl;
}
else
{
ServerLootItem_Struct* item = new ServerLootItem_Struct;
item->item_nr = dbitem->item_nr;
item->charges = atoi(row[2]);
item->equipSlot = 0;
(*itemlist).Append(item);
}

BUG RIGHT HERE>>>>mysql_free_result(result);
BUG RIGHT HERE >>>> return;
}
}
mysql_free_result(result);
}
else
{
cerr << "Error in AddLootDropToNPC query '" << query << "' " << errbuf << endl;
delete[] query;
return;
}

return;
}


No wonder you only get one item, the mysql result is freed after the loop is executed once.. Delete the mysql_free_result and return, and you should see loot drops with more than one item. I'm not 100% positive the rands are working as intended, but that will at least give you the full run through of the items on the mob to determine if they'll get added to the drop list.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
 


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 03:49 PM.


 

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