From 91ef43523e0cbb59187d50d21bbdb31b8eedf702 Mon Sep 17 00:00:00 2001 From: Dak2896 Date: Mon, 18 Feb 2019 15:18:44 +0100 Subject: [PATCH] Offset to player divide added (#739) * Offset added * membrane component added * ran code formatting * added marke to pos * RunCodeFormatting --- scripts/microbe_stage/setup.as | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/microbe_stage/setup.as b/scripts/microbe_stage/setup.as index 4993e4b910a..4d0a624eaa8 100644 --- a/scripts/microbe_stage/setup.as +++ b/scripts/microbe_stage/setup.as @@ -231,6 +231,7 @@ void onReturnFromEditor(CellStageWorld@ world) // Spawn another cell from the player species SpeciesComponent@ ourActualSpecies = MicrobeOperations::getSpeciesComponent(world, player); + auto membraneComponent = world.GetComponent_MembraneComponent(player); // Call this before creating the clone. Species::initProcessorComponent(world, player, ourActualSpecies); @@ -239,6 +240,12 @@ void onReturnFromEditor(CellStageWorld@ world) Species::copyProcessesFromSpecies(world, ourActualSpecies, player); PlayerSpeciesSpawner factory("Default"); + + // Offset between cells + pos._Position.X += membraneComponent.calculateEncompassingCircleRadius(); + pos._Position.Z += membraneComponent.calculateEncompassingCircleRadius(); + pos.Marked = true; + auto spawned = factory.factorySpawn(world, pos._Position); LOG_WRITE("TODO: the spawned cell from the player species from the editor split will "