--- deliantra/server/common/object.c 2006/02/22 18:53:48 1.3 +++ deliantra/server/common/object.c 2006/06/23 18:30:22 1.7 @@ -215,22 +215,22 @@ if (QUERY_FLAG(ob1, FLAG_APPLIED) || QUERY_FLAG(ob2, FLAG_APPLIED)) return 0; + switch (ob1->type) { + case SCROLL: + if (ob1->level != ob2->level) return 0; + break; + + } if (ob1->key_values != NULL || ob2->key_values != NULL) { /* At least one of these has key_values. */ if ((ob1->key_values == NULL) != (ob2->key_values == NULL)) { /* One has fields, but the other one doesn't. */ return 0; - } else { - return compare_ob_value_lists(ob1, ob2); + } else if (!compare_ob_value_lists(ob1, ob2)) { + return 0; } } - switch (ob1->type) { - case SCROLL: - if (ob1->level != ob2->level) return 0; - break; - - } /* Everything passes, must be OK. */ return 1; } @@ -1546,9 +1546,14 @@ /* Debugging information so you can see the last coordinates this object had */ op->ox=op->x; op->oy=op->y; + + /* Ideally, the caller figures this out. However, it complicates a lot + * of areas of callers (eg, anything that uses find_free_spot would now + * need extra work + */ + op->map=get_map_from_coord(m, &op->x, &op->y); x = op->x; y = op->y; - op->map=get_map_from_coord(m, &x, &y); /* this has to be done after we translate the coordinates. */ @@ -1561,16 +1566,6 @@ } } - /* Ideally, the caller figures this out. However, it complicates a lot - * of areas of callers (eg, anything that uses find_free_spot would now - * need extra work - */ - if (op->map != m) { - /* coordinates should not change unless map also changes */ - op->x = x; - op->y = y; - } - CLEAR_FLAG(op,FLAG_APPLIED); /* hack for fixing F_APPLIED in items of dead people */ CLEAR_FLAG(op, FLAG_INV_LOCKED); if (!QUERY_FLAG(op, FLAG_ALIVE)) @@ -1636,7 +1631,7 @@ (op->face && !op->face->visibility)) { for (last=top; last != floor; last=last->below) if (QUERY_FLAG(last, FLAG_BLOCKSVIEW)&&(last->type != EXIT)) break; - /* Check to see i we found the object that blocks view, + /* Check to see if we found the object that blocks view, * and make sure we have a below pointer for it so that * we can get inserted below this one, which requires we * set top to the object below us. @@ -2399,10 +2394,14 @@ int find_dir_2(int x, int y) { int q; - if(!y) + + if(y) + q=x*100/y; + else if (x) q= -300*x; else - q=x*100/y; + return 0; + if(y>0) { if(q < -242) return 3 ; @@ -2414,6 +2413,7 @@ return 8 ; return 7 ; } + if (q < -242) return 7 ; if (q < -41) @@ -2422,6 +2422,7 @@ return 5 ; if (q < 242) return 4 ; + return 3 ; } @@ -2727,8 +2728,6 @@ int set_ob_key_value_s(object * op, const char * canonical_key, const char * value, int add_key) { key_value * field = NULL, *last=NULL; - LOG(llevDebug, "set_ob_value_s: '%s' '%s' %d\n", canonical_key, value, add_key); - for (field=op->key_values; field != NULL; field=field->next) { if (field->key != canonical_key) { last = field;