From 9b597426ac45775f63b1fe4365c6fa8f3c3179af Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Mon, 18 Apr 2022 21:07:55 -0600 Subject: Wow this is some shitty fucking code god damn --- src/systems/undo.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/systems/undo.js') diff --git a/src/systems/undo.js b/src/systems/undo.js index 29f5bec..086d6b4 100644 --- a/src/systems/undo.js +++ b/src/systems/undo.js @@ -1,4 +1,4 @@ -game.system.Undo = (entitiesGrid) => { +game.system.Undo = (entitiesGrid, logicSystem, gridSystem) => { const states = []; const update = (elapsedTime, entities, changedIds) => { @@ -12,7 +12,7 @@ game.system.Undo = (entitiesGrid) => { states.push(state); } return new Set(); - } + }; const undo = (entities) => { let state = states.slice(0, -1).pop(); @@ -24,7 +24,9 @@ game.system.Undo = (entitiesGrid) => { entities[id].addComponent({name: componentName, ...state[id][componentName]}); } } - } + gridSystem.update(0, entities, new Set()); + logicSystem.parseRules(entities); + }; return { update, undo }; -} \ No newline at end of file +}; -- cgit v1.2.3-70-g09d2