mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
fix: fix crashing after minitouch fails to restart
This commit is contained in:
@@ -130,6 +130,12 @@ bool asst::MinitouchController::use_swipe_with_pause() const noexcept
|
||||
|
||||
bool asst::MinitouchController::click(const Point& p)
|
||||
{
|
||||
|
||||
if (!m_minitoucher) {
|
||||
Log.error("minitoucher is not initialized");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p.x < 0 || p.x >= m_width || p.y < 0 || p.y >= m_height) {
|
||||
Log.error("click point out of range");
|
||||
}
|
||||
@@ -143,6 +149,11 @@ bool asst::MinitouchController::click(const Point& p)
|
||||
bool asst::MinitouchController::swipe(const Point& p1, const Point& p2, int duration, bool extra_swipe, double slope_in,
|
||||
double slope_out, bool with_pause)
|
||||
{
|
||||
if (!m_minitoucher) {
|
||||
Log.error("minitoucher is not initialized");
|
||||
return false;
|
||||
}
|
||||
|
||||
int x1 = p1.x, y1 = p1.y;
|
||||
int x2 = p2.x, y2 = p2.y;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user