AnssiR66 / AlanStdLib

The Standard Library for ALAN Interactive Fiction Language
Other
6 stars 2 forks source link

Restriction Levels: Add Safety Checks #116

Closed tajmone closed 3 years ago

tajmone commented 3 years ago

To avoid unexpected erratic behavior in actions-restrictions levels, we should add a safety check in the check_restriction EVENT to sanitized the value of restricted_level — if it's greater than 5, it should be set to 5.

Some IF statements operate via "greater than", other via equality (especially for the newer level 5), so if restricted_level has a value superior to the highest supported level, the adventure could start to break down.

tajmone commented 3 years ago

Implemented and tested locally, works marvelously.