Using a macro function to define the value of macros in long recursive chains - normally using long recursive chains will throw errors - can cause Dream Maker to silently close down without warning when #undef is used before actual use of any of the macros.
Numbered Steps to Reproduce Problem:
1. If required for consistent reproduction, acquire a copy of a SS13 fork. I was working against a Baystation12 fork when this occured.
2. Do something like the code snippet below
3. Include it, in one way or other
Code Snippet (if applicable) to Reproduce Problem:
#define ABOVE(x) x + 1
#define LAYER_0 0
#define LAYER_1 ABOVE(LAYER_0)
#define LAYER_2 ABOVE(LAYER_1)
#define LAYER_23 ABOVE(LAYER_22)
#define LAYER_24 ABOVE(LAYER_23)
// This is where it'd crash
layer = LAYER_24
* Not crash
* Give an detailed error on the problem
* Silent crash without any warning
Does the problem occur:
Every time? Or how often? Consistently every time when attempting to do this on a fork of SS13.
In other games? Unknown
In other user accounts? N/A
On other computers? Unknown
When does the problem NOT occur?
Removing the #undef from the code will instead prompt an output of errors. Usually about "macro recursion level too deep"
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Not known, untested
* A proposed solution to prevent crashing and prompt errors is not using #undef
* Don't use recursive macro chains at all