Skip to content

Commit

Permalink
Merge pull request #110 from BlockHorizons/Chris-Prime-patch-1
Browse files Browse the repository at this point in the history
Improved inputs for Undo command (/undo all)
  • Loading branch information
Sandertv authored Oct 5, 2018
2 parents 681f411 + 98196a0 commit 00b94a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BlockHorizons/BlockSniper/commands/UndoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public function onExecute(CommandSender $sender, string $commandLabel, array $ar
$undoAmount = 1;
if(isset($args[0])){
$undoAmount = (int) $args[0];
if($undoAmount > ($totalUndo = SessionManager::getPlayerSession($sender)->getRevertStore()->getTotalStores(Revert::TYPE_UNDO))){
$totalUndo = SessionManager::getPlayerSession($sender)->getRevertStore()->getTotalStores(Revert::TYPE_UNDO);
if($undoAmount > $totalUndo || $args[0] === "all"){
$undoAmount = $totalUndo;
}
}
Expand Down

0 comments on commit 00b94a7

Please sign in to comment.