Fix #10438: [GS] Validate story page element type for ScriptStoryPage::NewElement...
commit76f0f9e38689d3a03fe42b3cd337b4ac2af33c37
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>
Sat, 27 Jan 2024 21:11:02 +0000 (27 21:11 +0000)
committerGitHub <noreply@github.com>
Sat, 27 Jan 2024 21:11:02 +0000 (27 22:11 +0100)
treece5c8a2480133972cea0d208f3dbb9725f783474
parent6d276698b6102918b6ac1d968dd7ec9a151bae52
Fix #10438: [GS] Validate story page element type for ScriptStoryPage::NewElement (#11888)

Fixes a crash that happens if an invalid StoryPageElementType is passed to ScriptStoryPage::NewElement.

Adds an enforced precondition that tests the validity of StoryPageElementType.

Adds GSStoryPage::IsValidStoryPageElementType to the API.
src/script/api/game_changelog.hpp
src/script/api/script_story_page.cpp
src/script/api/script_story_page.hpp