Bug Fixes
- Invalid palette numbers loaded colors from outside the palettes
1dfd38554npc->FrozenCSet, an enemy's boss palette, and a combo trigger's level and sprite palettes were used to load palettes without checking them. A number past the last palette copied whatever memory followed the palette data into the screen's colors, where a script could read it back. Such palettes are now ignored.
Bug present since at least 2.53-Beta-11 (429df347a1).
- Dropping an item from an invalid dropset read past the dropsets
5b027d7f7An enemy's npc->ItemSet, a combo's dropset attribute, and the dropset given by a generic script's item drop event were not checked before being used to pick a dropped item. A number past the last dropset picked an item from the memory after them. Now nothing drops.
Bug present since at least 2.53-Beta-11 (429df347a1).
- Magic mirror read past the DMaps with an invalid mirror DMap
9dd2319e6dmapdata->MirrorDMap accepted the number of DMaps, one past the last one, and the mirror DMap in a quest file was never checked. Using a magic mirror on such a DMap read its offset from past the DMaps. Now the mirror does nothing.
Bug introduced when magic mirrors were added in 2.55-alpha-100 (fa8db52d6d).
- An invalid continue or entrance DMap read and wrote outside the dmaps
4d34b2594The DMap to continue at, from the save file, the quest's starting DMap or Game->ContinueDMap, and Game->LastEntranceDMap weren't checked. The game would start or continue on that DMap, reading past the dmaps and marking it visited in memory past the list of visited dmaps. An invalid continue DMap now acts as DMap 0, and both script variables log an error for an invalid DMap.
Bug present since at least 2.53-Beta-11 (429df347a1).
- A combo type past the last one from the quest read past the combo type table
591622104A combo's type in a quest can be any number up to 255, but the table of combo type properties only had room for the valid types. Higher types read past the table wherever the game checks those properties, for example when checking for water or solid ground.
Bug present since at least 2.53-Beta-11 (429df347a1).
- Drawing an invalid 8x8 tile read past the tiles
eb506b1d0The functions that draw a quarter of a tile didn't check the tile, the way the ones that draw whole tiles do. Subscreen widgets, frames and minimap tiles from the quest could pass one past the last tile, which read tile data from past the end of the tiles and drew from wherever it pointed. Such tiles are now not drawn.
Bug present since at least 2.53-Beta-11 (429df347a1).
- [win] paths with non-ASCII characters failed before Windows 10 1903
ff6801ae8On Windows versions older than 10 1903, a save whose quest has an accented file name (like "Légende.qst"), a saves or quests folder with one, and music and script file names with one were no longer found.
Regressed in 3.0.0-prerelease.233+2026-10-29 (c01ebb4d8b).
- Prevent crash on some corrupt OGG files, and wrong gamepad mappings
f5c6d2ee6- Loading a corrupt OGG sound or music file could write outside of its buffer and crash.
- Some gamepad mappings (such as the "xinput" entries) could get mixed up with another device's mapping.
- On macOS, the window no longer goes blank while it is being resized.
Player
- Damaged save could write past a script object's variables
bb86f9cf9A save file says how many of a script object's values are its own variables, but that number was never checked against the number of values the object has. A crafted save made loading it read and clear memory past the object's values. Such a save now fails to load.
Bug introduced when global objects began saving to the save file in 2.55-alpha-112 (e9bc106b91).
- Damaged save with repeated script object ids corrupted memory
5880955b0A save file holding two script objects with the same id (say an array and a class object) replaced the first with the second, but kept listing the first under its own type. The engine then used the object as the wrong type, and could later write past its list of objects. Now an object whose id is already in use is dropped when the save loads.
Bug introduced when arrays began saving to the save file in 3.0.0-prerelease.118+2025-07-11 (4b40449cc8).
- Script without an end in a quest file read past it
432d9699eA quest file's script ends with a marker, and the engine finds the end of the script by looking for it. A damaged or crafted quest file whose script had none led the engine to read past the script, and run what it found there as more of it. The marker is now added when it is missing.
Bug introduced when ZScript was added, before 2.50.0.
- Script positions from a quest file could point outside of its ZASM
065bc478fA 3.0 quest file says where each script starts and ends in the quest's shared ZASM, and neither was checked. A crafted quest could start a script past the end of the ZASM, so running it read what followed in memory as script commands. Such a script is now disabled when the quest loads, with a warning.
Bug introduced when scripts began sharing their ZASM in 3.0.0-prerelease.102+2025-05-04 (51ec0e0a51).
- Damaged save could run an object's destructor from outside the script list
172c3ed41A script object in a save file records which script its destructor belongs to, and that number wasn't checked. A damaged or crafted save could give any number, and deleting the object then read a script from past the end of the list of scripts, and ran it. A destructor for an enemy, weapon or item that no longer exists crashed. Now neither runs.
Bug introduced when object destructors were added in 2.55-alpha-112 (af0f9e5949).
- Invalid onMap script from a quest read outside the script list
a72babcbfA DMap's onMap script is stored in the quest as a number that wasn't checked when it loaded. A damaged or crafted quest could give one past the last DMap script, and opening the map then read a script from past the end of the list of scripts. Such a DMap now has no onMap script.
Bug introduced when onMap scripts were added in 2.55-alpha-92 (9d6415a92b).
- Invalid DMap script from a current quest read outside the script list
ee4118af1A DMap's scripts (active, onMap, and the scripted active and passive subscreens) are stored in the quest as numbers. They were only checked for quests saved before 3.0.0-prerelease.205, so a damaged or crafted quest in the current format could give one past the last DMap script, and opening the subscreen or the map then read a script from past the end of the list of scripts. Such a DMap now has no script there.
Bug introduced when the quest format for script settings changed in 3.0.0-prerelease.205+2026-07-30 (76b97b95ee).
Editor
- Quest with scripts could not be opened again after saving
ad2521919Saving a quest wrote one more script command to its header than it saved, so opening the quest again failed with "Invalid quest file".
Regressed in 432d9699e5 (not yet in a release).
ZScript
- Shopdata arrays wrote outside the shops
f620df659shopdata's Item[], HasItem[], Price[] and String[] checked the index given to them, but not the shopdata. A script can make a shopdata out of any number, and for one that is neither a shop nor an info shop they read and wrote memory past the shops. Now they log an error for such a shopdata, and do nothing.
Bug introduced when shopdata was added in 2.54-Alpha-21 (0993538aeb).
- Dropsetdata one past the last dropset read and wrote past them
14c9dfc30Game->LoadDropset() and dropsetdata accepted the number of dropsets as a dropset, one past the last one. Its variables read and wrote memory just past the dropsets.
Bug introduced when dropsetdata was added in 2.55-alpha-44 (7383b32fc0).
Hero->Diraccepted directions the Hero can't face2b3b6ab44Hero->Dir could be set to any number, but the Hero's sprites only have the four main directions, and drawing the Hero looked up its tile from memory past them. Hero->Dir now logs an error for any other direction, and leaves the direction alone.
Bug present since at least 2.53-Beta-11 (429df347a1).
- Turning around a sprite with an invalid direction read garbage
732010ef9Scripts can give a weapon, enemy or item any direction. Reversing one whose direction wasn't one of the 8 (a reflected weapon, a bounced boomerang hitting a shield) read its new direction from past the end of a table. Now it gets no direction.
Bug present since at least 2.53-Beta-11 (429df347a1).
- Quad and Triangle with a size of 0 read outside the texture
d7c69b082Quad(), Triangle() and their 3D and bitmap versions require the tile width and height to be powers of two, but 0 passed that check. Drawing with an empty texture read pixels from outside it. A size of 0 is now rejected like the other invalid sizes.
Bug present since at least 2.53-Beta-11 (429df347a1).
- An eweapon with an invalid ID read past the Hero's defenses
6baee2a77A script can set a weapon's ID to any number, and when such an eweapon hit the Hero, the Hero's defense against it was read from past the end of the Hero's defenses. Unknown weapons now get the normal defense.
Bug introduced when the Hero's defenses were added in 2.55-alpha-86 (4d3bbaf096).
- An invalid defense from the enemy hit event read past the enemy's defenses
62bc9b5e0A generic script handling the enemy hit event could set the defense to use to any number, and higher ones than the enemy has read past its defenses. Such a hit is now ignored.
Bug introduced when the enemy hit event was added in 2.55-alpha-109 (f42eaa3ee6).
- A script running inside another one corrupted the outer script
253f45428Some commands run generic scripts from inside the command (like the zap and wavy effects, which run whole frames). The running script's state is global and wasn't put back afterwards, so scripts went on with another script's position, registers and stack, running the wrong code. The outer script's state is now restored.
Bug introduced when generic scripts started running during those frames in 2.55-alpha-107 (28603ced76).
npc->Frameset the npc's halt timer instead of its framecadc24a4cSetting npc->Frame changed npc->Halt and left the animation frame alone. It now sets the frame, which is what npc->Frame reads.
Regressed in 3.0.0-prerelease.172+2026-04-14 (a341cc6eb6).
- Read past the local arrays when every one was in use
91cbba0f3Only reachable with hand-written ZASM in a quest compiled before 3.0: making an array for a function's variadic arguments looked for a free array past the last one when all were taken.
Bug introduced when variadic parameters were added in 2.55-alpha-117 (f8a4240293).
Documentation
- Jump to anchor links instead of smooth scrolling
6f3ff052d
Refactors
ZScript
- Remove an unused screendata macro
70964d3c0SET_SCREENDATA_BOOL_INDEX was never used, and its error message passed its arguments in the wrong order (a number for %s).
Tests
- Trim idle tails off uploaded replays in replay_uploads.py
8b8a82a04Some uploads end with hours of nothing: the player paused, walked away, and closed the program much later. One replay has 74 seconds of play followed by 7 hours idle, which made it the longest-running replay in the set. When a replay runs more than 5 minutes past its last step (not counting the final quit), it is now cut off at that step. Playback stops at the last step, so none of the idle frames run.