Fixed add_to_lookup_table (#37)

* 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
This commit is contained in:
Nauzhror 2018-01-18 11:59:25 -05:00 committed by wyld-sw
parent 25e8daa43e
commit 770285c464

View file

@ -3004,9 +3004,15 @@ void add_to_lookup_table(long uid, void *c)
int bucket = (int) (uid & (BUCKET_COUNT - 1));
struct lookup_table_t *lt = &lookup_table[bucket];
for (;lt->next; lt = lt->next)
if (lt->c == c && lt->uid == uid) {
log ("Add_to_lookup failed. Already there. (uid = %ld)", uid);
if (lt && lt->uid == uid) {
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->c, c);
lt->c = c;
return;
}
for (;lt && lt->next; lt = lt->next)
if (lt->next->uid == uid) {
log("add_to_lookup updating existing value for uid=%ld (%p -> %p)", uid, lt->next->c, c);
return;
}