summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-05 01:26:54 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-05 01:26:54 -0300
commit3f44259523476583fd8ebafb256d843435a3eca9 (patch)
treed837020f6a2b018583b21b3dff2731a89d5fc0bc
parent58bdd794c4ddb4822de2fcee7269ac0864f77bf5 (diff)
downloadserverdata-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.txt12
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] )+":";