-- call stadium name for (MjTs-140914 Stadium Pack)
-- author: MjTs-140914, Created on Date (18/04/2018)
-- originally posted by MjTs-140914
-- additional credits: Juce & Nesa (For excellent sider tools)

local stadium_switch
local rc_config
local function stadium_callname(ctx, filename)
    stadium_switch = ctx.stadium
	rc_config = "rc_config"
	binary = ".bin"
	filematch = string.format("%s%s", rc_config, binary)
    if stadium_switch == 2 or stadium_switch == 4 or stadium_switch == 33 or stadium_switch == 51 or stadium_switch == 56 or stadium_switch == 57 then
	   rc_config = string.format("%s%s%s%s", rc_config, "_", stadium_switch, binary)
    else
	   rc_config = filematch
    end
	if stadium_switch then
       return string.gsub(filename, filematch, rc_config)
    end
 end

local function init(ctx)
    ctx.register("livecpk_rewrite", stadium_callname)
end
return { init = init }