mutators: remove pcalls
This commit is contained in:
parent
3e93de6ca7
commit
5943a29623
2 changed files with 9 additions and 9 deletions
|
@ -379,7 +379,7 @@ local mutators_view = {
|
||||||
-- Update the view after map_view has updated
|
-- Update the view after map_view has updated
|
||||||
manager:hook("MapView.update", function(func, map_view, dt, t)
|
manager:hook("MapView.update", function(func, map_view, dt, t)
|
||||||
func(map_view, dt, t)
|
func(map_view, dt, t)
|
||||||
manager:pcall(function() self:update(dt, t) end)
|
self:update(dt, t)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Activate the view on enter if it was active on exit
|
-- Activate the view on enter if it was active on exit
|
||||||
|
@ -387,14 +387,14 @@ local mutators_view = {
|
||||||
func(map_view)
|
func(map_view)
|
||||||
if self.was_active then
|
if self.was_active then
|
||||||
self.widgets.mutators_button.content.toggled = true
|
self.widgets.mutators_button.content.toggled = true
|
||||||
manager:pcall(function() self:activate() end)
|
self:activate()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Deactivate the view on exit
|
-- Deactivate the view on exit
|
||||||
manager:hook("MapView.on_exit", function(func, map_view)
|
manager:hook("MapView.on_exit", function(func, map_view)
|
||||||
func(map_view)
|
func(map_view)
|
||||||
manager:pcall(function() self:deactivate() end)
|
self:deactivate()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- We don't want to let the game disable steppers when mutators view is active
|
-- We don't want to let the game disable steppers when mutators view is active
|
||||||
|
@ -444,7 +444,7 @@ local mutators_view = {
|
||||||
-- Initialize mutators view after map view
|
-- Initialize mutators view after map view
|
||||||
manager:hook("MapView.init", function(func, self, ...)
|
manager:hook("MapView.init", function(func, self, ...)
|
||||||
func(self, ...)
|
func(self, ...)
|
||||||
manager:pcall(function() mutators_view:init(self) end)
|
mutators_view:init(self)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Destroy mutators view after map view
|
-- Destroy mutators view after map view
|
||||||
|
|
|
@ -277,14 +277,14 @@ end
|
||||||
MUTATOR'S OWN METHODS
|
MUTATOR'S OWN METHODS
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
-- Enables mutator (pcall for now)
|
-- Enables mutator
|
||||||
local function enable_mutator(self)
|
local function enable_mutator(self)
|
||||||
manager:pcall(function() set_mutator_state(self, true) end)
|
set_mutator_state(self, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Disables mutator (pcall for now)
|
-- Disables mutator
|
||||||
local function disable_mutator(self)
|
local function disable_mutator(self)
|
||||||
manager:pcall(function() set_mutator_state(self, false) end)
|
set_mutator_state(self, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Checks current difficulty, map selection screen settings (optionally), incompatible mutators and whether player is server
|
-- Checks current difficulty, map selection screen settings (optionally), incompatible mutators and whether player is server
|
||||||
|
@ -401,7 +401,7 @@ end)
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
-- Initialize mutators view when map_view has been initialized already
|
-- Initialize mutators view when map_view has been initialized already
|
||||||
manager:pcall(function() mutators_view:init(mutators_view:get_map_view()) end)
|
mutators_view:init(mutators_view:get_map_view())
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
Testing
|
Testing
|
||||||
|
|
Loading…
Add table
Reference in a new issue