SpecializationUtil.registerSpecialization("gasLimiter", "gasLimiter", g_currentModDirectory.."gasLimiter.lua") gasLimiter_Register = {}; function gasLimiter_Register:loadMap(name) if self.firstRun == nil then self.firstRun = false; print("--- loading gasLimiter - specialization for gasLimiter by Manuel Leithner (SFM-Modding)"); for k, v in pairs(VehicleTypeUtil.vehicleTypes) do if v ~= nil then local allowInsertion = true; for i = 1, table.maxn(v.specializations) do local vs = v.specializations[i]; if vs ~= nil and vs == SpecializationUtil.getSpecialization("steerable") then local v_name_string = v.name local point_location = string.find(v_name_string, ".", nil, true) if point_location ~= nil then local _name = string.sub(v_name_string, 1, point_location-1); if rawget(SpecializationUtil.specializations, string.format("%s.gasLimiter", _name)) ~= nil then allowInsertion = false; -- print(tostring(v.name)..": Specialization gasLimiter is present! gasLimiter was not inserted!"); end; end; if allowInsertion then -- print("adding gasLimiter to:"..tostring(v.name)); table.insert(v.specializations, SpecializationUtil.getSpecialization("gasLimiter")); end; end; end; end; end; end; end; function gasLimiter_Register:deleteMap() end; function gasLimiter_Register:keyEvent(unicode, sym, modifier, isDown) end; function gasLimiter_Register:mouseEvent(posX, posY, isDown, isUp, button) end; function gasLimiter_Register:update(dt) end; function gasLimiter_Register:draw() end; addModEventListener(gasLimiter_Register);