diff options
author | piernov <piernov@piernov.org> | 2016-04-23 17:16:42 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-04-23 17:16:42 +0200 |
commit | 198eaff1fb3469e27318592c4b592e2f099f41a1 (patch) | |
tree | e3a8eb740d03ea32ab70648af6f69a692d61aa0e /inc | |
parent | 446ac1001ec02bd55cd73cf6906d2681bd9e7b79 (diff) | |
download | candybox-198eaff1fb3469e27318592c4b592e2f099f41a1.tar.gz candybox-198eaff1fb3469e27318592c4b592e2f099f41a1.tar.bz2 candybox-198eaff1fb3469e27318592c4b592e2f099f41a1.tar.xz candybox-198eaff1fb3469e27318592c4b592e2f099f41a1.zip |
Fix Mine setup/update
Diffstat (limited to 'inc')
-rw-r--r-- | inc/mine.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/inc/mine.inc b/inc/mine.inc index 76c0055..aea04ad 100644 --- a/inc/mine.inc +++ b/inc/mine.inc @@ -5,13 +5,14 @@ function initCraftMine() { } function withdrawMine() { - $mine = $_SESSION["mine"]; - $_SESSION["mine"]["gold"] += $mine["mine"]; - $_SESSION["mine"]["mine"] = 0; + $amount = intval($_POST["amount"]); + if($amount == 0) return; + $_SESSION["mine"]["gold"] += $amount; + echo $_SESSION["mine"]["gold"]; } function sendMine() { - if(empty($_SESSION["mine"])) initMine(); + if(empty($_SESSION["mine"])) initCraftMine(); $mine = $_SESSION["mine"]; echo $mine["gold"]; } |