From 198eaff1fb3469e27318592c4b592e2f099f41a1 Mon Sep 17 00:00:00 2001 From: piernov Date: Sat, 23 Apr 2016 17:16:42 +0200 Subject: Fix Mine setup/update --- inc/mine.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'inc') 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"]; } -- cgit v1.2.3-70-g09d2