--- deliantra/server/common/friend.C 2007/01/06 14:42:28 1.8 +++ deliantra/server/common/friend.C 2007/01/08 01:19:02 1.9 @@ -28,10 +28,11 @@ * Add a new friendly object to the linked list of friendly objects. * No checking to see if the object is already in the linked list is done. */ - void add_friendly_object (object *op) { + op->flag [FLAG_FRIENDLY] = 1; + objectlink *ol; /* Add some error checking. This shouldn't happen, but the friendly @@ -39,7 +40,7 @@ * won't remove it either. Plus, it is easier to put a breakpoint in * the debugger here and see where the problem is happening. */ - for (ol = first_friendly_object; ol != NULL; ol = ol->next) + for (ol = first_friendly_object; ol; ol = ol->next) { if (ol->ob == op) { @@ -57,7 +58,6 @@ /* * Removes the specified object from the linked list of friendly objects. */ - void remove_friendly_object (object *op) { @@ -70,6 +70,7 @@ LOG (llevError, "remove_friendly_object called with empty friendly list, remove ob=%s\n", &op->name); return; } + /* if the first object happens to be the one, processing is pretty * easy. */ @@ -83,7 +84,7 @@ { objectlink *prev = first_friendly_object; - for (obj = first_friendly_object->next; obj != NULL; obj = obj->next) + for (obj = first_friendly_object->next; obj; obj = obj->next) { if (obj->ob == op) break; @@ -99,15 +100,14 @@ } /* - * Dumps all friendly objects. Invoked in DM-mode with the G key. + * Dumps all friendly objects. */ - void dump_friendly_objects (void) { objectlink *ol; - for (ol = first_friendly_object; ol != NULL; ol = ol->next) + for (ol = first_friendly_object; ol; ol = ol->next) LOG (llevError, "%s (%d)\n", &ol->ob->name, ol->ob->count); } @@ -151,9 +151,10 @@ { objectlink *ol; - for (ol = first_friendly_object; ol != NULL; ol = ol->next) + for (ol = first_friendly_object; ol; ol = ol->next) if (ol->ob == op) return 1; return 0; } +