diff options
author | Novatux <nathanael.courant@laposte.net> | 2015-05-12 11:19:52 +0200 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2015-05-12 20:48:55 +0200 |
commit | 75622c30beb390b7ed578010a00390aa971b3951 (patch) | |
tree | 3c9ff5b14e97ca60e70beb413fd01e992d6f4129 /builtin/game | |
parent | b4c3ff6eab197828d370c30d66e033cde9d2f13d (diff) | |
download | minetest-75622c30beb390b7ed578010a00390aa971b3951.tar.gz minetest-75622c30beb390b7ed578010a00390aa971b3951.tar.bz2 minetest-75622c30beb390b7ed578010a00390aa971b3951.zip |
Add code to support raillike group names
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/misc.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua index c31df541d..a71d5d02a 100644 --- a/builtin/game/misc.lua +++ b/builtin/game/misc.lua @@ -112,3 +112,14 @@ function core.record_protection_violation(pos, name) end end +local raillike_ids = {} +local raillike_cur_id = 0 +function core.raillike_group(name) + local id = raillike_ids[name] + if not id then + raillike_cur_id = raillike_cur_id + 1 + raillike_ids[name] = raillike_cur_id + id = raillike_cur_id + end + return id +end |