ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.c
(Generate patch)

Comparing deliantra/server/common/object.c (file contents):
Revision 1.3 by elmex, Wed Feb 22 18:53:48 2006 UTC vs.
Revision 1.5 by root, Mon May 29 15:28:24 2006 UTC

1/* 1/*
2 * static char *rcsid_object_c = 2 * static char *rcsid_object_c =
3 * "$Id: object.c,v 1.3 2006/02/22 18:53:48 elmex Exp $"; 3 * "$Id: object.c,v 1.5 2006/05/29 15:28:24 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
213 * some items equipped, and we don't want those to merge. 213 * some items equipped, and we don't want those to merge.
214 */ 214 */
215 if (QUERY_FLAG(ob1, FLAG_APPLIED) || QUERY_FLAG(ob2, FLAG_APPLIED)) 215 if (QUERY_FLAG(ob1, FLAG_APPLIED) || QUERY_FLAG(ob2, FLAG_APPLIED))
216 return 0; 216 return 0;
217 217
218 switch (ob1->type) {
219 case SCROLL:
220 if (ob1->level != ob2->level) return 0;
221 break;
222
223 }
218 if (ob1->key_values != NULL || ob2->key_values != NULL) { 224 if (ob1->key_values != NULL || ob2->key_values != NULL) {
219 /* At least one of these has key_values. */ 225 /* At least one of these has key_values. */
220 if ((ob1->key_values == NULL) != (ob2->key_values == NULL)) { 226 if ((ob1->key_values == NULL) != (ob2->key_values == NULL)) {
221 /* One has fields, but the other one doesn't. */ 227 /* One has fields, but the other one doesn't. */
222 return 0; 228 return 0;
223 } else {
224 return compare_ob_value_lists(ob1, ob2); 229 } else if (!compare_ob_value_lists(ob1, ob2)) {
230 return 0;
225 } 231 }
226 } 232 }
227 233
228 switch (ob1->type) {
229 case SCROLL:
230 if (ob1->level != ob2->level) return 0;
231 break;
232
233 }
234 /* Everything passes, must be OK. */ 234 /* Everything passes, must be OK. */
235 return 1; 235 return 1;
236} 236}
237 237
238/* 238/*
2725 * Returns TRUE on success. 2725 * Returns TRUE on success.
2726 */ 2726 */
2727int set_ob_key_value_s(object * op, const char * canonical_key, const char * value, int add_key) { 2727int set_ob_key_value_s(object * op, const char * canonical_key, const char * value, int add_key) {
2728 key_value * field = NULL, *last=NULL; 2728 key_value * field = NULL, *last=NULL;
2729 2729
2730 LOG(llevDebug, "set_ob_value_s: '%s' '%s' %d\n", canonical_key, value, add_key);
2731
2732 for (field=op->key_values; field != NULL; field=field->next) { 2730 for (field=op->key_values; field != NULL; field=field->next) {
2733 if (field->key != canonical_key) { 2731 if (field->key != canonical_key) {
2734 last = field; 2732 last = field;
2735 continue; 2733 continue;
2736 } 2734 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines