Skip to content

Commit

Permalink
Removed RunService:IsRunning hack
Browse files Browse the repository at this point in the history
  • Loading branch information
mkargus committed Dec 17, 2024
1 parent 501b4ca commit 23ba5ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/Components/PluginApp.luau
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local ChangeHistoryService = game:GetService('ChangeHistoryService')
local MarketplaceService = game:GetService('MarketplaceService')
local RunService = game:GetService('RunService')
local Selection = game:GetService('Selection')
local UserInputService = game:GetService('UserInputService')

Expand Down Expand Up @@ -34,17 +33,14 @@ local function GetInvisibleParts()
end

local function IsUpdateAvailable()
if not RunService:IsRunning() then
local CheckerID = Constants.IS_DEV_CHANNEL and Constants.DEV_UPDATE_CHECKER_ID or Constants.UPDATE_CHECKER_ID
local success, info = pcall(MarketplaceService.GetProductInfo, MarketplaceService, CheckerID)
local CheckerID = Constants.IS_DEV_CHANNEL and Constants.DEV_UPDATE_CHECKER_ID or Constants.UPDATE_CHECKER_ID
local success, info = pcall(MarketplaceService.GetProductInfo, MarketplaceService, CheckerID)

if success then
local LatestVersion = string.match(info.Description, '([0-9]+%.[0-9]+%.[0-9]+)')

if LatestVersion and LatestVersion ~= Constants.VERSION then
return true
end
if success then
local LatestVersion = string.match(info.Description, '([0-9]+%.[0-9]+%.[0-9]+)')

if LatestVersion and LatestVersion ~= Constants.VERSION then
return true
end
end

Expand Down Expand Up @@ -82,7 +78,6 @@ function PluginApp:init()
Localization('Plugin.Desc'),
Constants.PLUGIN_BUTTON_ICON
)
self.button.Enabled = RunService:IsRunning() ~= true

self.button.Click:Connect(function()
if not self.state.guiEnabled then
Expand Down Expand Up @@ -161,10 +156,6 @@ end
function PluginApp:render()
local state = self.state

if RunService:IsRunning() then
return nil
end

return React.createElement(StudioWidget, {
plugin = self.plugin,
Id = 'PartToTerrain',
Expand Down
6 changes: 6 additions & 0 deletions src/Main.server.luau
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ https://github.com/mkargus/PartToTerrain/blob/main/LICENSE.txt
]]

local RunService = game:GetService('RunService')

if RunService:IsRunning() then
return
end

if not plugin then
error('Part to Terrain has to be ran as a plugin.')
end
Expand Down

0 comments on commit 23ba5ff

Please sign in to comment.