1. Star Explorers
  2. News
  3. Refactoring Code

Refactoring Code

Nothing too exciting to report, however, I have spent this past week refactoring a lot of code in Star Explorers. I encountered quite a few pointers that were not properly conditioned, so they could have been resulting in random crashes. I fixed these, and also removed a bunch of pointers that were not being used.


The glamorous excitement of refactoring code, in all it's glorious splendor!

For anyone who does not know, pointers are references to game objects, that allow one game object to modify or effect another. However, if a script references a pointer, and that pointer has not yet been assigned, or has somehow been removed, then the game will crash.

By adding a line like this: "if (pointer exists)" before referencing it, I am able to make the script more stable. Most of my pointers already had these conditions set, but I guess there were a few that I did not write as carefully as I should have.

Now for some testing to make sure I didn't break anything along the way! I expect to release a new testing version of the game in the next few days.