Skip to content

Commit

Permalink
Trying to figure out why player species is throwing a null pointer, a…
Browse files Browse the repository at this point in the history
…dded debug logs, added world variable
  • Loading branch information
Untrustedlife committed Jun 29, 2018
1 parent 9daf8c8 commit 4fd0bba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/microbe_editor/microbe_editor.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "microbe_editor_hud.as"
#include "microbe_operations.as"
/*
////////////////////////////////////////////////////////////////////////////////
// MicrobeEditor
Expand Down Expand Up @@ -94,15 +95,21 @@ class MicrobeEditor{
GetThriveGame().playerData().setBool("edited_microbe", true);

const ObjectID microbe = GetThriveGame().playerData().activeCreature();
CellStageWorld@ world = GetThriveGame().getCellStage();

assert(world !is null, "world is null");
LOG_INFO("Microbe ID is "+microbe);

// We now just fetch the organelles in the player's creature
MicrobeComponent@ microbeComponent = cast<MicrobeComponent>(
GetThriveGame().getCellStage().GetScriptComponentHolder(
"MicrobeComponent").Find(microbe));

// This is failing here
SpeciesComponent@ playerSpecies = MicrobeOperations::getSpeciesComponent(
GetThriveGame().getCellStage(), microbe);
world, microbe);

LOG_INFO(playerSpecies.name);
assert(microbeComponent !is null, "player creature state is invalid");
assert(playerSpecies !is null, "player creature state is invalid");

Expand Down

0 comments on commit 4fd0bba

Please sign in to comment.