mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-19 10:01:45 +01:00
Bugfixes (#38)
* Added %log%, and made %send%, %echo%, etc. not force capitalization. * Fixed Previous Commit * Really fixed this time. * Fixed look 2.mail Also reverted CMMAND_TERMS, was increased in previous commit when it didn't need to be due to the removed of marena. * Fixed add_to_lookup_table Fixed as per Welcor https://www.tbamud.com/forum/2-general/4307-crash-bug-need-assistance-with-gdb?start=20#7390 * Fixed two crash bugs Fixed tw crash bugs Welcor found here https://www.tbamud.com/forum/4-development/4300-simple-list-forced-to-reset-itself
This commit is contained in:
@@ -268,6 +268,7 @@ void * simple_list(struct list_data * pList)
|
||||
|
||||
void * random_from_list(struct list_data * pList)
|
||||
{
|
||||
struct iterator_data localIterator;
|
||||
void * pFoundItem;
|
||||
bool found;
|
||||
int number;
|
||||
@@ -278,17 +279,17 @@ void * random_from_list(struct list_data * pList)
|
||||
else
|
||||
number = rand_number(1, pList->iSize);
|
||||
|
||||
pFoundItem = merge_iterator(&Iterator, pList);
|
||||
pFoundItem = merge_iterator(&localIterator, pList);
|
||||
|
||||
for (found = FALSE; pFoundItem != NULL; pFoundItem = next_in_list(&Iterator), count++) {
|
||||
for (found = FALSE; pFoundItem != NULL; pFoundItem = next_in_list(&localIterator), count++) {
|
||||
if (count == number) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
remove_iterator(&Iterator);
|
||||
|
||||
remove_iterator(&localIterator);
|
||||
|
||||
if (found)
|
||||
return (pFoundItem);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user