Skip to content

Commit

Permalink
Fixed loadFromJSON delete method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nrosa01 committed May 1, 2024
1 parent 9ad1d4e commit 14faa20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stores/simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export const useSimulationStore = defineStore("simulation", () => {

const loadFromJSON = (json) => {
// We have to make sure to remove the old particles from the wasm memory

// Print how many particles are being removed
for (let i = 1; i < particle_array.value.length; i++) {
wasm_exports.remove_plugin(js_object(i.toString()));
wasm_exports.remove_plugin(js_object("1")); // We remove the first particle every time, we are removing all of them anyway
}

ParticleModel.used_names.clear();
Expand Down

0 comments on commit 14faa20

Please sign in to comment.