Skip to content

Commit

Permalink
Bugfixes (#38)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Nauzhror authored and wyld-sw committed Jan 19, 2018
1 parent 770285c commit fe8f93a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/fight.c
Expand Up @@ -930,8 +930,11 @@ void perform_violence(void)
continue;
}

if (GROUP(ch)) {
while ((tch = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) {
if (GROUP(ch) && GROUP(ch)->members && GROUP(ch)->members->iSize) {
struct iterator_data Iterator;

tch = (struct char_data *) merge_iterator(&Iterator, GROUP(ch)->members);
for (; tch ; tch = next_in_list(&Iterator)) {
if (tch == ch)
continue;
if (!IS_NPC(tch) && !PRF_FLAGGED(tch, PRF_AUTOASSIST))
Expand Down
9 changes: 5 additions & 4 deletions src/lists.c
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit fe8f93a

Please sign in to comment.