mutators: remove pcalls

This commit is contained in:
UnShame 2018-02-22 17:24:05 +03:00
parent 3e93de6ca7
commit 5943a29623
2 changed files with 9 additions and 9 deletions

View file

@ -379,7 +379,7 @@ local mutators_view = {
-- Update the view after map_view has updated
manager:hook("MapView.update", function(func, map_view, dt, t)
func(map_view, dt, t)
manager:pcall(function() self:update(dt, t) end)
self:update(dt, t)
end)
-- Activate the view on enter if it was active on exit
@ -387,14 +387,14 @@ local mutators_view = {
func(map_view)
if self.was_active then
self.widgets.mutators_button.content.toggled = true
manager:pcall(function() self:activate() end)
self:activate()
end
end)
-- Deactivate the view on exit
manager:hook("MapView.on_exit", function(func, map_view)
func(map_view)
manager:pcall(function() self:deactivate() end)
self:deactivate()
end)
-- 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
manager:hook("MapView.init", function(func, self, ...)
func(self, ...)
manager:pcall(function() mutators_view:init(self) end)
mutators_view:init(self)
end)
-- Destroy mutators view after map view

View file

@ -277,14 +277,14 @@ end
MUTATOR'S OWN METHODS
]]--
-- Enables mutator (pcall for now)
-- Enables mutator
local function enable_mutator(self)
manager:pcall(function() set_mutator_state(self, true) end)
set_mutator_state(self, true)
end
-- Disables mutator (pcall for now)
-- Disables mutator
local function disable_mutator(self)
manager:pcall(function() set_mutator_state(self, false) end)
set_mutator_state(self, false)
end
-- 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
manager:pcall(function() mutators_view:init(mutators_view:get_map_view()) end)
mutators_view:init(mutators_view:get_map_view())
--[[
Testing