From 802426b84292c7e51a101cbd4ebd2c0758e9aee9 Mon Sep 17 00:00:00 2001 From: ANAND Date: Tue, 26 Mar 2019 07:28:58 +0530 Subject: [PATCH] physics: Remove assertions and physics.change (#394) Without the assertion, physics.set does the exact same thing physics.change would do. --- mods/other/physics/init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/other/physics/init.lua b/mods/other/physics/init.lua index f57bc30..0c4fbcf 100644 --- a/mods/other/physics/init.lua +++ b/mods/other/physics/init.lua @@ -29,19 +29,19 @@ local function update(name) end function physics.set(pname, name, modifiers) - assert(players[pname] and not players[pname][name]) + if not players[pname] then + return + end + players[pname][name] = modifiers update(pname) end -function physics.change(pname, name, modifier) - assert(players[pname] and players[pname][name]) - players[pname][name] = modifier - update(pname) -end - function physics.remove(pname, name) - assert(players[pname] and players[pname][name]) + if not players[pname] then + return + end + players[pname][name] = nil update(pname) end