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:
parent
22ca8de079
commit
802426b842
1 changed files with 8 additions and 8 deletions
|
@ -29,19 +29,19 @@ local function update(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
function physics.set(pname, name, modifiers)
|
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
|
players[pname][name] = modifiers
|
||||||
update(pname)
|
update(pname)
|
||||||
end
|
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)
|
function physics.remove(pname, name)
|
||||||
assert(players[pname] and players[pname][name])
|
if not players[pname] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
players[pname][name] = nil
|
players[pname][name] = nil
|
||||||
update(pname)
|
update(pname)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue