physics: Remove assertions and physics.change (#394)

Without the assertion, physics.set does the exact same thing physics.change would do.
This commit is contained in:
ANAND 2019-03-26 07:28:58 +05:30 committed by GitHub
parent 22ca8de079
commit 802426b842
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
function physics.remove(pname, name)
if not players[pname] then
return
end
function physics.remove(pname, name)
assert(players[pname] and players[pname][name])
players[pname][name] = nil
update(pname)
end