diff options
author | Och Noe <och_noe@forksworld.de> | 2021-05-11 19:45:15 +0200 |
---|---|---|
committer | Och Noe <och_noe@forksworld.de> | 2021-05-11 19:45:15 +0200 |
commit | 0d978fdf33e7b5dc7e2d5d02fbe32ed94f038180 (patch) | |
tree | 28750fe44262636bf741fad956e62c7825d9074e | |
parent | 448171c68cfaf8e4fe5553016a2b7026bf9d5b0c (diff) | |
download | cs_waypoints-0d978fdf33e7b5dc7e2d5d02fbe32ed94f038180.tar.gz cs_waypoints-0d978fdf33e7b5dc7e2d5d02fbe32ed94f038180.tar.bz2 cs_waypoints-0d978fdf33e7b5dc7e2d5d02fbe32ed94f038180.zip |
don't overwrite waypoints while setting
-rw-r--r-- | init.lua | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -327,6 +327,13 @@ minetest.register_chatcommand('wp_set', { func = safe(function(param) waypoints = load_waypoints() local point = minetest.localplayer:get_pos() + if waypoints[param] then + minetest.display_chat_message( + ('waypoint "%s" not saved: already set'):format(param) + ) + return + end + waypoints[param] = point mod_storage:set_string('waypoints', minetest.serialize(waypoints)) |