Skip to content

Commit

Permalink
Change greedy search to lazy search
Browse files Browse the repository at this point in the history
A greedy replacement will unintentionally override the save data for other mods. This simple fix will resolve that issue.
  • Loading branch information
bennett-zhang committed Jun 28, 2023
1 parent 69a3429 commit c138fff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cookiemonsterteam/cookiemonsterframework",
"version": "0.2.3",
"version": "0.2.4",
"description": "A package with functions used in the Cookie Monste Mod Framework",
"keywords": [
"mod",
Expand Down
2 changes: 1 addition & 1 deletion src/savingAndLoading/saveFramework.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function saveFramework() {
const cookieClickerSaveString = b64_to_utf8(
unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0],
);
const pattern = new RegExp(`${modName}.*(;|$)`);
const pattern = new RegExp(`${modName}.*?(;|$)`);
const modSave = cookieClickerSaveString.match(pattern);
if (modSave !== null) {
const newSaveString = cookieClickerSaveString.replace(
Expand Down

0 comments on commit c138fff

Please sign in to comment.