--- deliantra/server/common/object.c 2006/05/29 15:28:24 1.5 +++ deliantra/server/common/object.c 2006/06/23 18:30:22 1.7 @@ -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 ; }