Features
ZScript
- add LEGACY_ARRAYS option as more lenient approach to array syntax
caeb93357
This replaces the
OLD_ARRAY_TYPECASTING
option withLEGACY_ARRAYS
. It can be set toon
,off
, orwarn
, and defaults towarn
. This option supports usage of deprecated syntax for arrays. This will continue to work:int arr = {1, 2}; Trace(arr[0]);
- by default, this will warn that
int[] arr
is the preferred syntax - legacy arrays syntax is currently not allowed for objects that must be
free'd, such as custom classes or
bitmap
(but, for example,lweapon
is fine)
Additionally but independent of this option, parameter types are cast to/from arrays when resolving a function call. There was an existing feature that selects the function that required the fewest type casts, and this taps into that. For example, this code works:
void fnArray(int[] arr) {} void fnLegacyArray(int arr) {} ... int legacy_arr = {1}; fnArray(arr); // arr is cast to int[] int arr = {1}; fnLegacyArray(arr); // arr is cast to int
- by default, this will warn that
Bug Fixes
Player
- reset playing_field_offset at beginning of scroll
5a520f4d4
This prevents the draw offset from a quake from persisting during a scroll.
See https://discord.com/channels/876899628556091432/1238226802867048529
Editor
- 3-stair warp dialog not properly listing catchall purpose
6ab8d137e
ZScript Standard Library (std.zh)
- use template for
Cond
to support arraysaf4293cd6
Also deprecate and suggest using ternary expressions.
ZScript
- dealloc owned objects for all combos in loadscr
50a9996df
For some reason, only the combo at position 0 had its owned objects deallocated when loading a new screen. Now they all do.
- 'OwnArray()' not working properly at all
d706df903
Refactors
ZScript
- make all command strings match enum name
08e0c08e5
This normalizes all the string names for commands to be the same as the enum name used in code, and rewrites
get_script_command
to be an explicit mapping of this string representation and the enum value. These not matching was confusing, and was a potential source of future bugs. - tweak
Region->
and screen script internals in preparation for z37b421826c
Region->OriginScreen
is now of typescreendata
, andRegion->OriginScreenIndex
is added to return just the screen index.Similar change made to
Region->GetScreenForComoboPos(int pos)
. - remove unused features from ZScriptArray
c09b58133
Various things are just a wrapper around what std::vector does, and we don't need dimensions, a template, or a custom iterator.
- remove duplicated function deallocateZScriptArray
d061e3c55