Skip to content

Commit 7256d6d

Browse files
authored
fix(unstuck): prevent unstuck when it is on cooldown (#176)
1 parent 99c81b1 commit 7256d6d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/acore-wp-plugin/src/Components/UnstuckMenu/UnstuckController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ public static function unstuck($charName)
2929
foreach ($characters as $character) {
3030
if ($character['name'] === $charName) {
3131

32-
$soap->unstuckByName($charName);
32+
$currentTime = time();
33+
if ($character["time"] < $currentTime) {
34+
$soap->unstuckByName($charName);
3335

34-
self::updateUnstuckCD($charName);
36+
self::updateUnstuckCD($charName);
3537

36-
return $charName . " unstucked!";
38+
return $charName . " unstucked!";
39+
}
40+
41+
return $charName . " unstuck still on cooldown!";
3742
}
3843
}
3944

0 commit comments

Comments
 (0)