local builtin_error = builtin_error or error
local ASSERT = function(condition, ...)
  if not condition then
    local mobdebug = package.loaded.mobdebug
    local msg
    msg = "assertion failed!"
    if next({
      ...
    }) then
      local s, r = pcall(function(...)
        return (string.format(...))
      end, ...)
      if s then
        msg = "assertion failed: " .. r
      end
    end
    if mobdebug then
      mobdebug.pause()
      return
    end
    builtin_error(msg, 2)
  end
  return condition
end
assert = ASSERT
