summaryrefslogtreecommitdiff
path: root/npc/items/shovel.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-01-14 21:30:58 -0200
committerJesusaves <cpntb1@ymail.com>2019-01-14 21:30:58 -0200
commitdc184a3dc52158992e31d87a63ba9866482ce282 (patch)
treef13e37b506560ab8c2de40e6623d4b9bdd684484 /npc/items/shovel.txt
parent28e92d8bb50e70d51cf7d71c98b67468641efb28 (diff)
downloadserverdata-dc184a3dc52158992e31d87a63ba9866482ce282.tar.gz
serverdata-dc184a3dc52158992e31d87a63ba9866482ce282.tar.bz2
serverdata-dc184a3dc52158992e31d87a63ba9866482ce282.tar.xz
serverdata-dc184a3dc52158992e31d87a63ba9866482ce282.zip
Sacrifice some performance to check cells where items will be burried.
If it is not walkable, don't bury the item, failing silently. This will reduce random crap array size and thus, optimize memory.
Diffstat (limited to 'npc/items/shovel.txt')
-rw-r--r--npc/items/shovel.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt
index 63d4f677c..fc30b9168 100644
--- a/npc/items/shovel.txt
+++ b/npc/items/shovel.txt
@@ -14,6 +14,11 @@ function script shovel_scriptItem {
.@id=getarg(3);
.@amount=getarg(4,1);
+ // Players can't walk on this cell, why bother?
+ if (!checkcell(.map$, .@x, .@y, cell_chkpass))
+ return;
+
+ // Bury the item, they're renewed daily at 00:00
.@wtc = getarraysize($@WBT_Random_id);
$@WBT_Random_id[.@wtc] = .@id;
$@WBT_Random_amount[.@wtc] = .@amount;