1 | /* |
1 | /* |
2 | * static char *rcsid_friend_c = |
2 | * static char *rcsid_friend_c = |
3 | * "$Id: friend.C,v 1.3 2006/08/31 17:54:14 root Exp $"; |
3 | * "$Id: friend.C,v 1.4 2006/09/03 00:18:39 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
42 | * the debugger here and see where the problem is happening. |
42 | * the debugger here and see where the problem is happening. |
43 | */ |
43 | */ |
44 | for (ol=first_friendly_object; ol!=NULL; ol=ol->next) { |
44 | for (ol=first_friendly_object; ol!=NULL; ol=ol->next) { |
45 | if (ol->ob == op) { |
45 | if (ol->ob == op) { |
46 | LOG(llevError, "add_friendly_object: Trying to add object already on list (%s)\n", |
46 | LOG(llevError, "add_friendly_object: Trying to add object already on list (%s)\n", |
47 | op->name); |
47 | &op->name); |
48 | return; |
48 | return; |
49 | } |
49 | } |
50 | } |
50 | } |
51 | |
51 | |
52 | ol=first_friendly_object; |
52 | ol=first_friendly_object; |
… | |
… | |
64 | objectlink *obj; |
64 | objectlink *obj; |
65 | |
65 | |
66 | CLEAR_FLAG(op,FLAG_FRIENDLY); |
66 | CLEAR_FLAG(op,FLAG_FRIENDLY); |
67 | |
67 | |
68 | if (!first_friendly_object) { |
68 | if (!first_friendly_object) { |
69 | LOG(llevError,"remove_friendly_object called with empty friendly list, remove ob=%s\n", op->name); |
69 | LOG(llevError,"remove_friendly_object called with empty friendly list, remove ob=%s\n", &op->name); |
70 | return; |
70 | return; |
71 | } |
71 | } |
72 | /* if the first object happens to be the one, processing is pretty |
72 | /* if the first object happens to be the one, processing is pretty |
73 | * easy. |
73 | * easy. |
74 | */ |
74 | */ |
… | |
… | |
103 | |
103 | |
104 | void dump_friendly_objects(void) { |
104 | void dump_friendly_objects(void) { |
105 | objectlink *ol; |
105 | objectlink *ol; |
106 | |
106 | |
107 | for(ol=first_friendly_object;ol!=NULL;ol=ol->next) |
107 | for(ol=first_friendly_object;ol!=NULL;ol=ol->next) |
108 | LOG(llevError, "%s (%d)\n",ol->ob->name,ol->ob->count); |
108 | LOG(llevError, "%s (%d)\n", &ol->ob->name, ol->ob->count); |
109 | } |
109 | } |
110 | |
110 | |
111 | /* New function, MSW 2000-1-14 |
111 | /* New function, MSW 2000-1-14 |
112 | * It traverses the friendly list removing objects that should not be here |
112 | * It traverses the friendly list removing objects that should not be here |
113 | * (ie, do not have friendly flag set, freed, etc) |
113 | * (ie, do not have friendly flag set, freed, etc) |