From f626cb94bc812e779c4c90d85dbc516a04efa232 Mon Sep 17 00:00:00 2001
From: tenplus1 <tenplus1@users.noreply.github.com>
Date: Mon, 4 Jul 2016 09:12:37 +0100
Subject: [PATCH] merge upstream commit: Game_api.txt: Add API information for
 sethome functions

---
 game_api.txt | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/game_api.txt b/game_api.txt
index 93cf0527..6ef7ce2b 100644
--- a/game_api.txt
+++ b/game_api.txt
@@ -333,6 +333,30 @@ To use it, add the `on_screwdriver` function to the node definition.
  * use `on_rotate = screwdriver.disallow` to always disallow rotation
  * use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
 
+
+Sethome API
+-----------
+
+The sethome API adds three global functions to allow mods to read a players home position,
+set a players home position and teleport a player to home position.
+
+`sethome.get(name)`
+
+ * `name` Player who's home position you wish to get
+ * return value: false if no player home coords exist, position table if true
+
+`sethome.set(name, pos)`
+
+ * `name` Player who's home position you wish to set
+ * `pos` Position table containing coords of home position
+ * return value: false if unable to set and save new home position, otherwise true
+
+`sethome.go(name)`
+
+ * `name` Player you wish to teleport to their home position
+ * return value: false if player cannot be sent home, otherwise true
+
+
 Stairs API
 ----------
 
-- 
GitLab