mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-27 18:42: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
|
||||
|
||||
function Player:_loadConfig(config)
|
||||
assert(config, 'No config table provided')
|
||||
assert(config.controls, 'No controls specified')
|
||||
if not config then
|
||||
error('No config table provided', 4)
|
||||
end
|
||||
if not config.controls then
|
||||
error('No controls specified', 4)
|
||||
end
|
||||
config.pairs = config.pairs or {}
|
||||
config.deadzone = config.deadzone or .5
|
||||
config.squareDeadzone = config.squareDeadzone or false
|
||||
|
Reference in New Issue
Block a user