Depending on serialization order is not a good idea here, so now it's no longer stored as a parent in the main level script but explicitly checked for when looking for a variable.
This is what should be audible. To prevent other levels from playing sound, all entry points check whether the sound playing entity belongs to the current UI level.
src/c_dispatch.cpp:143:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
src/tarray.h:582:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
src/tarray.h:574:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
This was done to ensure that this code only runs when the thinker itself is fully set up.
With a constructor there is no control about such things, if some common initialization needs to be done it has to be in the base constructor, but that makes the entire approach chosen here to ensure proper linking into the thinker chains impossible.
ZDoom originally did it that way, which resulted in a very inflexible system and required some awful hacks to let the serializer work with it - the corresponding bSerialOverride flag is now gone.
The only thinker class still having a constructor is DFraggleThinker, because it contains non-serializable data that needs to be initialized in a piece of code that always runs, regardless of whether the object is created explicitly or from a savegame.
Doing this intermingled with the thinkers is highly unsafe because there are absolutely no guarantees about order of execution.
Effectively it ran these commands right in the middle of the playsim which could cause all sorts of synchronization issues, because CCMDs are part of the UI, not the playsim.
- pass a const string to AddCommandString.
This function manipulated the input buffer, leading to all sorts of code contortions to make sure that the passed parameter is clean for that.
This function will now create a copy of the passed parameter which it can manipulate without complicating its calling code.
# Conflicts:
# src/c_dispatch.cpp
This doesn't really write out any info for the pointer, if the level does not match it just errors out.
This is both for quick detection of badly used level data and for automatic restoring of the pointer from the serializer's working level.
This also removed the temporary workarounds in DAutomap and DLevelScript to restore these pointers when a savegame is loaded.
This was a relatively cheap change but removes a significant batch of references to the global variable, only making the entry points to the ACS interpreter relevant.
UI always runs on the primary level, so this does not need the ability to operate on multiple levels. Additionally, this can later be set to null when running play code so that scope violations result in an abort.
This also changes the action special interface to pass a Level parameter to the separate functions and makes a few other minor adjustments to the polyobject code.
This should later be done for everything else as well, but the map loader should really be free of global dependencies ASAP.
Also replace TThinkerIterator<AActor> with FThinkerIterator globally because this only adds pointless type checks - with all actor subclasses being scripted this class has become redundant.
This entered the code path which warned about ambiguous use of variables in action functions and as a result ran afoul of subsequent error checks.
Since ZScript has no global scope resolution operator, this needs to ignore all non-static class symbols and try to look up any of these as global identifiers.
This caused bad calculations with CMF_OFFSETPITCH. Note that to compensate for the fix, the SphericalCoords function had to have its own inversion of the value removed so that it calculates the same result as before.
Apparently some people have to pass positive numbers in here to get a negative pitch, e.g. 350.0 instead of -10.0...
This prevents clamping of such out-of-range values that would otherwise constitute valid pitches with the wraparound in place.
Using global variables for this is bad, and it didn't even catch all cases. Now a node build is only considered successful if everything is set up successfully.
# Conflicts:
# src/maploader/maploader.cpp
src/scripting/decorate/thingdef_parse.cpp:80:11: error: no viable conversion from 'const FName' to 'FString'
src/scripting/zscript/zcc_compile.cpp:1359:26: error: use of undeclared identifier 'Name_globalfreeze'; did you mean 'NAME_globalfreeze'?
# Conflicts:
# src/scripting/zscript/zcc_compile.cpp
They are intentionally omitted from both MAPINFO and compatibility settings.
This removes the last place where it still went through the map-modified versions of the compatflags.
# Conflicts:
# src/s_sound.cpp