mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02:00
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:
parent
25e8daa43e
commit
770285c464
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue