ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/shop.C
(Generate patch)

Comparing deliantra/server/server/shop.C (file contents):
Revision 1.51 by root, Fri Apr 25 11:40:34 2008 UTC vs.
Revision 1.52 by root, Fri May 2 16:16:02 2008 UTC

1068{ 1068{
1069 shopinv *s1 = (shopinv *) a1, *s2 = (shopinv *) a2; 1069 shopinv *s1 = (shopinv *) a1, *s2 = (shopinv *) a2;
1070 1070
1071 if (s1->type < s2->type) 1071 if (s1->type < s2->type)
1072 return -1; 1072 return -1;
1073
1073 if (s1->type > s2->type) 1074 if (s1->type > s2->type)
1074 return 1; 1075 return 1;
1075 1076
1076 /* the type is the same (what atoi gets), so do a strcasecmp to sort 1077 /* the type is the same (what atoi gets), so do a strcasecmp to sort
1077 * via alphabetical order 1078 * via alphabetical order
1210 1211
1211/* elmex: this function checks whether the object is in a shop */ 1212/* elmex: this function checks whether the object is in a shop */
1212bool 1213bool
1213is_in_shop (object *o) 1214is_in_shop (object *o)
1214{ 1215{
1215 if (!o->map) 1216 if (!o->is_on_map ())
1216 return false; 1217 return false;
1217 1218
1218 return is_in_shop (o->map, o->x, o->y); 1219 return is_in_shop (o->map, o->x, o->y);
1219} 1220}
1220 1221
1228is_in_shop (maptile *map, int x, int y) 1229is_in_shop (maptile *map, int x, int y)
1229{ 1230{
1230 for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) 1231 for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above)
1231 if (QUERY_FLAG (floor, FLAG_IS_FLOOR)) 1232 if (QUERY_FLAG (floor, FLAG_IS_FLOOR))
1232 return floor->type == SHOP_FLOOR; 1233 return floor->type == SHOP_FLOOR;
1234
1233 return false; 1235 return false;
1234} 1236}
1235 1237

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines