From 3f44259523476583fd8ebafb256d843435a3eca9 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 5 Mar 2019 01:26:54 -0300 Subject: Without the magic numbers this time --- npc/012-8/doorbell.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/npc/012-8/doorbell.txt b/npc/012-8/doorbell.txt index c64f9abb9..59eab6a3f 100644 --- a/npc/012-8/doorbell.txt +++ b/npc/012-8/doorbell.txt @@ -132,22 +132,16 @@ L_Furniture: for (.@i=0; .@i < getarraysize(.layer); .@i++) { //debugmes "Found object ID %d named %s on layer %s coords (%d,%d) - Looking for layer %d", .@i, .name$[.@i], .layer[.@i], .x1[.@i], .y1[.@i], @re_col; - if (.layer[.@i] == @re_col) { - // We have a valid object - // So we can populate a second array? - // Allow to buy/sell and also setcells with params - // Maybe an htable would work better (name$, .@id) + if (.layer[.@i] == @re_col) array_push(@valid_ids, .@i); - //debugmes "Pushing"; - } } - debugmes "Found %d valid objects", getarraysize(@valid_ids); + //debugmes "Found %d valid objects", getarraysize(@valid_ids); // Add a function here @menuentries$=""; for (.@j=0; .@j < getarraysize(@valid_ids); .@j++) { .@i=@valid_ids[.@j]; - if ($ESTATE_MOBILIA_128[.id] & .objid[.@i]) + if (realestate_hasmobilia(.id, .layer[.@id], .objid[.@id])) { @menuentries$+=("Sell ")+.name$[.@i]+l(" for ") + format_number( realestate_sellprice(.id,.price[.@i]) ) +":"; else @menuentries$+=("Purchase ")+.name$[.@i]+(" for ") + format_number( .price[.@i] )+":"; -- cgit v1.2.3-60-g2f50