mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02: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:
parent
770285c464
commit
fe8f93a6b2
2 changed files with 10 additions and 6 deletions
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue