Skip to content

Commit

Permalink
Offset to player divide added (Revolutionary-Games#739)
Browse files Browse the repository at this point in the history
* Offset added

* membrane component added

* ran code formatting

* added marke to pos

* RunCodeFormatting
  • Loading branch information
Dak2896 authored and hhyyrylainen committed Feb 18, 2019
1 parent d164e56 commit 91ef435
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/microbe_stage/setup.as
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 "
Expand Down

0 comments on commit 91ef435

Please sign in to comment.