From 08f5368e1ca46f4efa4fbcf044541722661c0b29 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Mon, 10 Jan 2022 18:38:43 -0500 Subject: [PATCH] feat: Issue #51, stop time when player reaches max age --- layouts/default.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/default.vue b/layouts/default.vue index 50a1441..57ff6e5 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -43,10 +43,12 @@ export default { }, mounted() { window.setInterval(() => { - this.gametick() + if (this.$store.state.playerAge < this.$store.state.playerAgeMax) + this.gametick() }, 100) window.setInterval(() => { - this.$store.commit('tickGameDate') + if (this.$store.state.playerAge < this.$store.state.playerAgeMax) + this.$store.commit('tickGameDate') }, 1000) }, methods: {