From 75622c30beb390b7ed578010a00390aa971b3951 Mon Sep 17 00:00:00 2001 From: Novatux Date: Tue, 12 May 2015 11:19:52 +0200 Subject: Add code to support raillike group names --- builtin/game/misc.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'builtin') 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 -- cgit v1.2.3