diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-04-16 17:28:16 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-04-16 17:28:16 -0700 |
commit | e37234b2da5075409d12d345d7cd73b6ea803f5f (patch) | |
tree | fa3f8c432574ffccc51bbb3677069d2beac94856 | |
parent | 08319bf6cc57dff43640957ba9e2daf857603c88 (diff) | |
download | pathery-e37234b2da5075409d12d345d7cd73b6ea803f5f.tar.xz |
Map Editor fixes
-rw-r--r-- | includes/mapclass.php | 2 | ||||
-rw-r--r-- | pages/mapeditor.php | 42 |
2 files changed, 42 insertions, 2 deletions
diff --git a/includes/mapclass.php b/includes/mapclass.php index c4d95e9..8e9f28e 100644 --- a/includes/mapclass.php +++ b/includes/mapclass.php @@ -295,8 +295,8 @@ class map { $oldNames['r'] = 'r'; $oldNames['r2'] = 'R'; + $oldNames['r3'] = 'q'; - $oldNames['q'] = 'q'; $oldNames['p'] = 'p'; for( $i = 0; $i < $this->height; $i++) { diff --git a/pages/mapeditor.php b/pages/mapeditor.php index 3134d51..4d395c4 100644 --- a/pages/mapeditor.php +++ b/pages/mapeditor.php @@ -35,10 +35,50 @@ if ($_REQUEST['genMap']) { } + + +//Add's a new custom challenge map - returns mapid +function addNewChallengeMap($map, $tier, $subOrder, $name) { + $mapcode = GenerateMapCode($map); + + $sql = "INSERT INTO `challengeMaps` + (`code`, `ChallengeTier`, `ChallengeSuborder`, `Name`) + VALUES + ('$mapcode', $tier, $subOrder, '$name')"; + + echo $sql; + mysql_query($sql); + $mapID = mysql_insert_id(); + return $mapID; +} + +//Returns challenge ID +function addNewChallenge($mapID, $inequality, $goal, $ordering, $hint, + $restrictWallCount = 'null', $restrictWallPlacement = 'null', $restrictTeleportCount = 'null', + $restrictTeleportsUsed = 'null', $restrictStartPoint = 'null', $restrictEndPoint = 'null') { + + $sql = "INSERT INTO `challenges` ( + `mapID`, `inequality`, `goal`, `ordering`, `hint`, + `restrictWallCount`, `restrictWallPlacement`, `restrictTeleportCount`, + `restrictTeleportsUsed`, `restrictStartPoint`, `restrictEndPoint` + ) + VALUES ( + '$mapID', '$inequality', $goal, $ordering, '$hint', + '$restrictWallCount', '$restrictWallPlacement', '$restrictTeleportCount', + '$restrictTeleportsUsed', '$restrictStartPoint', '$restrictEndPoint' + )"; + + echo $sql; + mysql_query($sql); + $challengeID = mysql_insert_id(); + return $challengeID; +} + +// Start Page: + htmlHeader(array('stats', 'mapeditor'), 'Map Editor', 'Map Editor', array('dateformat')); - ?> |