Skip to content

Commit

Permalink
Bug fix, cooldown working properly now
Browse files Browse the repository at this point in the history
  • Loading branch information
luca28pet committed Sep 7, 2015
1 parent 7818f9b commit 5e451c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AdvancedKits
main: AdvancedKits\Main
version: 4.0
version: 4.0.1
api: [1.12.0]

load: POSTWORLD
Expand Down
6 changes: 4 additions & 2 deletions src/AdvancedKits/Kit.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ private function addTo(Player $player){
$this->ak->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{player}", $player->getName(), $cmd));
}
}
$this->coolDowns[strtolower($player->getName())] = $this->getCoolDownMinutes();
if(($cd = $this->getCoolDownMinutes()) > 0){
$this->coolDowns[strtolower($player->getName())] = $cd;
}
$this->ak->hasKit[strtolower($player->getName())] = true;
}

Expand Down Expand Up @@ -119,7 +121,7 @@ private function getCoolDownLeft(Player $player){
public function processCoolDown(){
foreach($this->coolDowns as $player => $min){
$this->coolDowns[$player] -= 1;
if($this->coolDowns[$player] === 0){
if($this->coolDowns[$player] <= 0){
unset($this->coolDowns[$player]);
}
}
Expand Down

0 comments on commit 5e451c7

Please sign in to comment.