Skip to content

Commit

Permalink
Fix dynamite tool (fix #108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcreedcmu committed Dec 10, 2023
1 parent 0efd583 commit 5d91813
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/core/intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export type Intent =
;

function dynamiteableCell(cell: CellContents): boolean {
// XXX more things should be dynamiteable (#108)
return cell.t == 'tile' || (cell.t == 'bonus' && cell.bonus.t == 'block');
return cell.t == 'tile' || (cell.t == 'bonus' && (cell.bonus.t != 'empty'));
}

export function getIntentOfMouseDown(tool: Tool, wp: WidgetPoint, button: number, mods: Set<string>, hoverCell: CellContents, pinned: boolean): Intent {
Expand Down
3 changes: 2 additions & 1 deletion src/core/state-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ export function checkValid(state: CoreState): CoreState {
s.animations = animations;

// XXX: is this the right place to do this?
s.currentTool = 'pointer';
if (state.currentTool != 'dynamite')
s.currentTool = 'pointer';
});
}

Expand Down

0 comments on commit 5d91813

Please sign in to comment.