mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-28 02:52:19 +00:00
improve error messages
these error messages will now tell the user where they made a mistake, rather than saying that something's wrong in baton.lua
This commit is contained in:
@@ -76,8 +76,12 @@ local Player = {}
|
|||||||
Player.__index = Player
|
Player.__index = Player
|
||||||
|
|
||||||
function Player:_loadConfig(config)
|
function Player:_loadConfig(config)
|
||||||
assert(config, 'No config table provided')
|
if not config then
|
||||||
assert(config.controls, 'No controls specified')
|
error('No config table provided', 4)
|
||||||
|
end
|
||||||
|
if not config.controls then
|
||||||
|
error('No controls specified', 4)
|
||||||
|
end
|
||||||
config.pairs = config.pairs or {}
|
config.pairs = config.pairs or {}
|
||||||
config.deadzone = config.deadzone or .5
|
config.deadzone = config.deadzone or .5
|
||||||
config.squareDeadzone = config.squareDeadzone or false
|
config.squareDeadzone = config.squareDeadzone or false
|
||||||
|
Reference in New Issue
Block a user