From fa1fd7b3bc2842d30eeab3fb9448a75a432d9f34 Mon Sep 17 00:00:00 2001 From: nothere Date: Fri, 30 Jul 2004 17:23:22 +0000 Subject: [PATCH] =?utf8?q?=E5=8F=A4=E3=81=84=E3=82=BB=E3=83=BC=E3=83=96?= =?utf8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=8B=E3=82=89=E6=88=91=E3=81=8C?= =?utf8?q?=E5=AE=B6=E3=83=87=E3=83=BC=E3=82=BF=E3=82=92=E8=AA=AD=E3=82=80?= =?utf8?q?=E9=9A=9B=E3=81=AE=E3=82=A2=E3=82=A4=E3=83=86=E3=83=A0=E3=82=BD?= =?utf8?q?=E3=83=BC=E3=83=88=E6=9D=A1=E4=BB=B6=E3=81=AB=E3=82=82=20object?= =?utf8?q?=5Fsort=5Fcomp()=E3=82=92=E7=94=A8=E3=81=84=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/load.c | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/src/load.c b/src/load.c index 618ddb43a..78845cc3d 100644 --- a/src/load.c +++ b/src/load.c @@ -1077,7 +1077,7 @@ static void rd_lore(int r_idx) static void home_carry(store_type *st_ptr, object_type *o_ptr) { int slot; - s32b value, j_value; + s32b value; int i; object_type *j_ptr; @@ -1110,45 +1110,7 @@ static void home_carry(store_type *st_ptr, object_type *o_ptr) /* Check existing slots to see if we must "slide" */ for (slot = 0; slot < st_ptr->stock_num; slot++) { - /* Get that item */ - j_ptr = &st_ptr->stock[slot]; - - /* Hack -- readable books always come first */ - if ((o_ptr->tval == mp_ptr->spell_book) && - (j_ptr->tval != mp_ptr->spell_book)) break; - if ((j_ptr->tval == mp_ptr->spell_book) && - (o_ptr->tval != mp_ptr->spell_book)) continue; - - /* Objects sort by decreasing type */ - if (o_ptr->tval > j_ptr->tval) break; - if (o_ptr->tval < j_ptr->tval) continue; - - /* Can happen in the home */ - if (!object_is_aware(o_ptr)) continue; - if (!object_is_aware(j_ptr)) break; - - /* Objects sort by increasing sval */ - if (o_ptr->sval < j_ptr->sval) break; - if (o_ptr->sval > j_ptr->sval) continue; - - /* Objects in the home can be unknown */ - if (!object_is_known(o_ptr)) continue; - if (!object_is_known(j_ptr)) break; - - /* - * Hack: otherwise identical rods sort by - * increasing recharge time --dsb - */ - if (o_ptr->tval == TV_ROD) - { - if (o_ptr->pval < j_ptr->pval) break; - if (o_ptr->pval > j_ptr->pval) continue; - } - - /* Objects sort by decreasing value */ - j_value = object_value(j_ptr); - if (value > j_value) break; - if (value < j_value) continue; + if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break; } /* Slide the others up */ -- 2.11.0