The shapes library has such pointer chains. The leaks were getting pretty heavy because they included pointers to C4AulFuncs, which kept a lot of parts of the script engine and string tables in memory.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
The desync was caused by PropList->GetProperties returning the properties in an arbitrary order. They are now sorted first.
The debug logs are left in place, because I assume that I will need them again and they prove to be helpful.
While none of the mismatches were having a side-effect, this silences a
number of -Wreorder warnings which were drowning out potentially
important diagnostics.
Example: this.EditCursorCommands = ["Explode(20)"] on an item will offer a menu entry to explode the object. Commands may be either strings or function pointers, but function pointers will always be called by name.
src/script/C4Script.cpp:159:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (long i = 0; i < sizeof(values) / sizeof(*values); ++i) \
^
I would prefer to render the models for speaker portraits directly. However, it seems like it's not currently possible to clip or render models to offscreen surfaces.
The distinction between the "aul" and "non-aul" parts of
the script engine are mostly historical accident, and the
current organization of the source code does not use
sub-subdirectories. I'd like to keep it that way.
This reverts commit 69ba06b8d0.
Par() calls and '...' in function calls make functions take varargs
without this being obvious from the header. ExtraWarn about this so people
who care about it can add an ellipsis to the parameter list.
Accepting an ellipsis as the final parameter in a function declaration
makes it immediately obvious that the function can take a variable number
of parameters
If an object moves and other objects are attached to its SolidMask, only objects in front of this plane are moved along with it. Defaults to Plane if zero.
This makes C4Script consistent with C-based languages, and current usage
on master shows that in the majority of cases, the author expected to have
to place a semicolon after the loop anyway.
There have been some bugs and crashes related to unwanted deep comparison (e.g. in the maze scenario). Scripters very rarely need deep comparison, so it should not be the default for the most commonly used operator.
This also changes behaviour of GetIndexOf to do pointer comparison.
This change has Guenther's seal of approval.
This is mostly to prevent crashes when prototypes are deleted.
Also change proplist savegame format to not include the constant flag - all
constant proplists are not stored in savegames anymore, but recreated from
the game data. Store the prototype at that position instead.
Factor the common if (TokenType != t) UnexpectedToken() into a function.
Write the end-of-list-or-comma as one if and one Match instead of a long
switch-case-statement.
CheckParTypes now requires that the parameter array passed in is long
enough, just like Exec does. Luckily, FnCall has a ParSet, which is always
long enough.