github ZQuestClassic/ZQuestClassic 3.0.0-prerelease.54+2024-05-26
3.0 Prerelease 54 2024-05-26

pre-release26 days ago

To download this release, visit the ZQuest Classic website or see the bottom of this page.

The following are the changes since 3.0.0-prerelease.53+2024-05-08:

Features

ZScript

  • add LEGACY_ARRAYS option as more lenient approach to array syntax caeb93357
     

    This replaces the OLD_ARRAY_TYPECASTING option with LEGACY_ARRAYS. It can be set to on, off, or warn, and defaults to warn. 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
    

Bug Fixes

Player

Editor

  • 3-stair warp dialog not properly listing catchall purpose 6ab8d137e

ZScript Standard Library (std.zh)

  • use template for Cond to support arrays af4293cd6
     

    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 z3 7b421826c
     

    Region->OriginScreen is now of type screendata, and Region->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

Tests

  • add newbie_boss.zplay and recompile test b1b4d8203
  • add snapshot test for compiling the zscript database 46e71c1d8

Don't miss a new ZQuestClassic release

NewReleases is sending notifications on new releases.