forked from Quasic/DragonBasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get.pl
28 lines (26 loc) · 845 Bytes
/
get.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# external, get an object from ground
$version="1.0";
$filestamp=glob "$datadir/dynamic/$player{'tmap'}/$form{'j'}??????????$player{'tz'}.txt";
#print "pop=$form{'j'} - $filestamp\n";
if ($filestamp) {
$f=index($player{'inven'}, "Za");
if ($f>-1) {
($item,$filestamp,$z)=split(/ /, $filestamp);
$item=substr($item,-2);
if ($item eq $form{'j'}) {
$player{'inven'}=substr($player{'inven'},0,$f).$item.$filestamp.substr($player{'inven'},$f+10);
do 'inv.pl';#print "inv=$player{'inven'}\n";
print "dinv=1\n";
unlink "$datadir/dynamic/$player{'tmap'}/$item $filestamp $player{'tz'}.txt";
} else {
print "pop=mismatch\n";
}
} else {
print "pop=no space $f\n";
}
} else {
if (glob "$datadir/static/$player{'tmap'}/$form{'j'}??????????$player{'tz'}.txt") {
do "static.pl";
}
}
1;