Skip to content

Commit

Permalink
Godot error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesScholz committed May 25, 2024
1 parent 13f471d commit 521198c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void Cell::_ready() {

this->set_pickable(true);

CellMembrane *cellMembrane = this->get_node<CellMembrane>("CellMembrane");
CellMembrane *cellMembrane = Object::cast_to<CellMembrane>(this->get_node_or_null("CellMembrane"));
if (cellMembrane) {
_spriteSize = cellMembrane->getSpriteSize();
cellMembrane->connect("cell_growth", Callable(this, "_on_cell_growth"));
Expand Down Expand Up @@ -291,7 +291,7 @@ void Cell::_process(double delta) {
// Living Cell behavior

// Kill Cells without CellMembranes
CellMembrane *cellMembrane = this->get_node<CellMembrane>("CellMembrane");
CellMembrane *cellMembrane = Object::cast_to<CellMembrane>(this->get_node_or_null("CellMembrane"));
if (!cellMembrane) {
_cellState->setAlive(false);
this->emit_signal("cell_death", this);
Expand Down
1 change: 0 additions & 1 deletion src/cell_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void CellEnvironment::addCell(Cell *cell) {
void CellEnvironment::removeCell(Cell *cell) {
_lineageGraph.removeVertex(cell);

this->remove_child(cell);
cell->resetCollisions();
cell->queue_free();
}
Expand Down
3 changes: 0 additions & 3 deletions src/cell_spawner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ void CellSpawner::_on_cell_reproduction(Cell *cell) {
cell->emit_signal("cell_death", cell);
cell->clearStatsOnDeath(cell);

childCell->connect("cell_death", Callable(cellEnvironment, "_on_cell_death"));
secondCell->connect("cell_death", Callable(cellEnvironment, "_on_cell_death"));

// Check for Nuclei and if present, attach reproduction signal
Nucleus *nucleus = cellObject->get_node<Nucleus>("Nucleus");
if (nucleus)
Expand Down

0 comments on commit 521198c

Please sign in to comment.