Index: cpp/frams/genetics/f4/f4_general.cpp
===================================================================
--- cpp/frams/genetics/f4/f4_general.cpp	(revision 1236)
+++ cpp/frams/genetics/f4/f4_general.cpp	(revision 1237)
@@ -4,5 +4,5 @@
 
 // Copyright (C) 1999,2000  Adam Rotaru-Varga (adam_rotaru@yahoo.com), GNU LGPL
-// 2018, Grzegorz Latosinski, added support for new API for neuron types and development checkpoints
+// 2018, Grzegorz Latosinski, added development checkpoints and support for new API for neuron types
 
 #include "f4_general.h"
@@ -145,10 +145,5 @@
 }
 
-
-/* return codes:
-	1 error at pos
-	0  halt development (yield) for a cycle
-	*/
-int f4_Cell::oneStep()
+void f4_Cell::oneStep()
 {
 	while (gcur != NULL)
@@ -184,5 +179,5 @@
 					// cannot fix
 					org->setError(gcur->pos);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 
@@ -224,6 +219,5 @@
 				// adjustments for this cell
 				gcur = gcur->child;
-				// halt development
-				return 0;
+				return;  // error code not set -> halt this development and yield to other cells to develop
 			}
 			case '>':
@@ -271,5 +265,5 @@
 						if (org->setRepairInsert(gcur->pos, gcur, insertnode)) // not in repair mode, release
 							delete insertnode;
-						return 1;
+						return;  // error code set -> stop further cells development
 					}
 					repeat.clear();
@@ -280,5 +274,5 @@
 						logPrintf("f4_Cell", "oneStep", LOG_WARN, "Ignoring junk genetic code: %d node(s) at position %d", remaining_nodes, gcur->child->pos); //let's see an example of such a genotype...
 					gcur = NULL;
-					return 0;
+					return;  // done development
 				}
 			}
@@ -294,5 +288,5 @@
 					// fix: delete it
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				repeat.push(repeat_ptr(gcur, gcur->reps));
@@ -314,5 +308,5 @@
 					// fix: delete it
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				switch (name)
@@ -345,5 +339,5 @@
 					// fix: delete it
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				P.executeModifier(name);
@@ -359,9 +353,9 @@
 					// fix: delete this node
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				type = CELL_STICK;
 				// fix dad commacount and own anglepos
-				if (NULL != dadlink)
+				if (dadlink != NULL)
 				{
 					dadlink->commacount++;
@@ -370,5 +364,5 @@
 				// change of type halts developments, see comment at 'neuclasshandler' below
 				gcur = gcur->child;
-				return 0;
+				return;  // error code not set -> halt this development and yield to other cells to develop
 			}
 			case '[':
@@ -380,5 +374,5 @@
 					// fix: delete it
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				// input [%d:%g]
@@ -419,5 +413,5 @@
 					// cannot fix
 					org->setError(gcur->pos);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				gcur = gcur->child;
@@ -434,5 +428,6 @@
 				active = false; // next time when we reach wait_conn, we will not count ourselves as active (if we were the last active cell, we got a chance to continue development for one development step only)
 				if (active_count > 0)
-					return 0;  // there is at least one active (including ourselves), halt, try again
+					// there is at least one active (including ourselves), halt, try again
+					return;  // error code not set -> halt this development and yield to other cells to develop
 
 #ifdef TREAT_BAD_CONNECTIONS_AS_INVALID_GENO // MacKo 2023-04: there were so many invalid connections accumulating in the genotype (and stopping processing of the chain of gcur->child) that it looks like treating them as errors is better... in 2000's, Framsticks neurons were flexible when it comes to inputs and outputs (for example, when asked, muscles would provide an output too, and neurons that ignored inputs would still accept them when connected) so f4 could create connections pretty randomly, but after 2000's we attempt to respect neurons' getPreferredInputs() and getPreferredOutput() so the network of connections has more constraints.
@@ -450,5 +445,5 @@
 					active = true; //not sure if needed, but let this cell have the chance to continue for as long as many children in the tree are left
 					gcur = gcur->child;
-					return 0;
+					return;  // error code not set -> halt this development and yield to other cells to develop
 				}
 				else
@@ -456,5 +451,5 @@
 					//org->setError(gcur->pos); //in case setRepairRemove() would not always produce reasonable results
 					org->setRepairRemove(gcur->pos, gcur); //produces unexpected results? or NOT? TODO verify, some genotypes earlier produced strange outcomes of this repair (produced a valid genotype, but some neurons were multiplied/copied after repair - maybe because when a branch of '<' (or something else) is missing, the other branch is copied?)
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 #else
@@ -472,5 +467,5 @@
 					// fix: delete it
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				switch (gcur->prop_symbol)
@@ -496,5 +491,5 @@
 				default:
 					org->setRepairRemove(gcur->pos, gcur);
-					return 1;  // stop
+					return;  // error code set -> stop further cells development
 				}
 				gcur = gcur->child;
@@ -502,10 +497,12 @@
 			}
 			case ' ':
-			{
-				// space has no effect, should not occur
+			case '\t':
+			case '\n':
+			case '\r':
+			{
+				// whitespace has no effect, should not occur
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
-				gcur = gcur->child;
-				break;
+				return;  // error code set -> stop further cells development
 			}
 			default:
@@ -515,5 +512,5 @@
 				logMessage("f4_Cell", "oneStep", LOG_ERROR, buf.c_str());
 				org->setRepairRemove(gcur->pos, gcur);
-				return 1;
+				return;  // error code set -> stop further cells development
 			}
 			}
@@ -526,5 +523,5 @@
 				// fix: delete this node
 				org->setRepairRemove(gcur->pos, gcur);
-				return 1;  // stop
+				return;  // error code set -> stop further cells development
 			}
 			// error: if no previous
@@ -533,5 +530,5 @@
 				// fix: delete it
 				org->setRepairRemove(gcur->pos, gcur);
-				return 1;  // stop
+				return;  // error code set -> stop further cells development
 			}
 			neuclass = gcur->neuclass;
@@ -541,9 +538,8 @@
 			// to wait for other cells to turn to neurons before adding connections
 			gcur = gcur->child;
-			return 0; //stop
+			return;  // error code not set -> halt this development and yield to other cells to develop
 		}
 	}
 	active = false;  // done
-	return 0;
 }
 
@@ -675,6 +671,6 @@
 	for (int i = 0; i < old_cell_count; i++)
 	{
-		int cellstep_ret = C[i]->oneStep(); //keeps calling independently of C[i]->active
-		if (cellstep_ret > 0)
+		C[i]->oneStep(); //keeps calling independently of C[i]->active
+		if (errorcode != GENOPER_OK)
 		{
 			// error
@@ -685,5 +681,5 @@
 	for (int i = 0; i < cell_count; i++) //we check all cells, including newly created ones
 		if (C[i]->active)
-			return true; //at least one cell is still active. TODO maybe the development should stop NOT because of the "active" field (there is this strange "yielding" state too), but by observing the progress of all cells and continuing the development while (errorcode==0 AND (gcur of at least one cell changed OR cell_count changed)) ? Also get rid of return 1/return 0, just observe error.
+			return true; //at least one cell is still active. TODO maybe the development should stop NOT because of the "active" field (there is this strange "yielding" state too), but by observing the progress of all cells and continuing the development while (errorcode==GENOPER_OK AND (gcur of at least one cell changed OR cell_count changed)) ?
 	return false;
 }
Index: cpp/frams/genetics/f4/f4_general.h
===================================================================
--- cpp/frams/genetics/f4/f4_general.h	(revision 1236)
+++ cpp/frams/genetics/f4/f4_general.h	(revision 1237)
@@ -150,9 +150,11 @@
 	 * differentiation or modification is performed on the cell. If current node is
 	 * creating a connection between two neuron nodes and the input node is not
-	 * yet developed, the simulation of the development of the current cell waits until
-	 * the input node is created. The onestep method is deployed for every cell
-	 * at least once. If one cell requires another one to develop, onestep
-	 * should be deployed again on this cell. This method, unlike genotype tree
-	 * creation, checks semantics. This means that this function will fail if:
+	 * yet developed, the simulation of the development of the current cell returns
+	 * to wait until the input node is created. The oneStep method is deployed for every cell
+	 * at least once. If one cell requires another one to develop, oneStep
+	 * should be deployed again on this cell.
+	 * 
+	 * This method, unlike genotype tree creation, checks semantics. This means that
+	 * this function will fail (set error code) if:
 	 *  - the cell differentiated as a stick will have branching node '<',
 	 *  - the undifferentiated cell will have termination node '>' (end of cell development without differentiation),
@@ -163,7 +165,8 @@
 	 *  - the neuron class is not valid.
 	 *
-	 * @return 0 if development was successful, 1 if there was an error in genotype tree
-	 */
-	int oneStep();
+	 * This function returns either because the development of this cell was completed,
+	 * or it was halted (yielding to other cells), or the error code was set in the f4_Cells object in the org attribute.
+	 */
+	void oneStep();
 
 	/**
