diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-03-05 01:26:54 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-03-05 01:26:54 -0300 |
commit | 3f44259523476583fd8ebafb256d843435a3eca9 (patch) | |
tree | d837020f6a2b018583b21b3dff2731a89d5fc0bc | |
parent | 58bdd794c4ddb4822de2fcee7269ac0864f77bf5 (diff) | |
download | serverdata-3f44259523476583fd8ebafb256d843435a3eca9.tar.gz serverdata-3f44259523476583fd8ebafb256d843435a3eca9.tar.bz2 serverdata-3f44259523476583fd8ebafb256d843435a3eca9.tar.xz serverdata-3f44259523476583fd8ebafb256d843435a3eca9.zip |
Without the magic numbers this time
-rw-r--r-- | npc/012-8/doorbell.txt | 12 |
1 files 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] )+":"; |