View Single Post
  #7  
Old 08-09-2004, 03:25 AM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default

The only thing I worry about are loottables that are not set up correctly...where multiplier is greater than the total number of items in the table. This will cause found to never be set to 1, and cause an infinite loop.

I think this will fix it, but defintely needs some testing (currently at work, not able to test ATM):

In function
Code:
const LootTable_Struct* Database::GetLootTable(int32 loottable_id) {:
Code:
			loottable_array[loottable_id]->Entries[i].lootdrop_id = atoi(row[1]);
			loottable_array[loottable_id]->Entries[i].multiplier = atoi(row[2]);
			loottable_array[loottable_id]->Entries[i].probability = atoi(row[3]);

+			if(loottable_array[loottable_id]->Entries[i].multiplier > NumEntries);
+				loottable_array[loottable_id]->Entries[i].multiplier = NumEntries;

			i++;
		}
		mysql_free_result(result);
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote