Reset connection on unignore

This commit is contained in:
TotallyNotElite 2018-10-28 16:18:11 +01:00
parent 72a1318299
commit 3328acf252

View File

@ -263,6 +263,8 @@ public:
static void updateIgnores() static void updateIgnores()
{ {
static Timer update{}; static Timer update{};
static Timer last_pather_reset{};
static bool reset_pather = false;
if (!update.test_and_set(500)) if (!update.test_and_set(500))
return; return;
updateDanger(); updateDanger();
@ -277,13 +279,17 @@ public:
{ {
i.second.status = unknown; i.second.status = unknown;
i.second.stucktime = 0; i.second.stucktime = 0;
reset_pather = true;
} }
break; break;
case unknown: case unknown:
break; break;
case danger_found: case danger_found:
if (i.second.ignoreTimeout.check(20000)) if (i.second.ignoreTimeout.check(20000))
{
i.second.status = unknown; i.second.status = unknown;
reset_pather = true;
}
break; break;
case vischeck_failed: case vischeck_failed:
case vischeck_success: case vischeck_success:
@ -292,6 +298,7 @@ public:
{ {
i.second.status = unknown; i.second.status = unknown;
i.second.stucktime = 0; i.second.stucktime = 0;
reset_pather = true;
} }
break; break;
} }
@ -299,6 +306,11 @@ public:
} }
else else
checkPath(); checkPath();
if (reset_pather && last_pather_reset.test_and_set(10000))
{
reset_pather = false;
ResetPather();
}
} }
static bool isSafe(CNavArea *area) static bool isSafe(CNavArea *area)
{ {