Skip to content

Commit

Permalink
Fixed display of cookie clicks being lower after loading Cookie Monst…
Browse files Browse the repository at this point in the history
…er (Issue #238)
  • Loading branch information
Aktanusa committed Mar 14, 2019
1 parent 9b0f416 commit d0f5a55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CookieMonster.js
Original file line number Diff line number Diff line change
Expand Up @@ -2675,6 +2675,10 @@ CM.ReplaceNative = function() {
CM.Disp.FixMouseY(CM.Backup.UpdateSpecial);
}

// Assumes newer browsers
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
l('bigCookie').addEventListener('click', function() { CM.Disp.FixMouseY(Game.ClickCookie); }, false);

// Probably better to load per minigame
CM.Backup.scriptLoaded = Game.scriptLoaded;
Game.scriptLoaded = function(who, script) {
Expand Down
4 changes: 4 additions & 0 deletions src/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ CM.ReplaceNative = function() {
CM.Disp.FixMouseY(CM.Backup.UpdateSpecial);
}

// Assumes newer browsers
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
l('bigCookie').addEventListener('click', function() { CM.Disp.FixMouseY(Game.ClickCookie); }, false);

// Probably better to load per minigame
CM.Backup.scriptLoaded = Game.scriptLoaded;
Game.scriptLoaded = function(who, script) {
Expand Down

0 comments on commit d0f5a55

Please sign in to comment.