Fix #10439: [GS] Validate story page button colour, flags, cursor and vehicle type (#11892)

Adds GSStoryPage::IsValidStoryPageButtonColour, GSStoryPage::IsValidStoryPageButtonFlags and GSStoryPage::IsValidStoryPageButtonCursor to the API.

Add missing enforced preconditions to validate parameters passed to MakePushButtonReference, MakeTileButtonReference and MakeVehicleButtonReference.
This commit is contained in:
SamuXarick
2024-01-27 23:29:10 +00:00
committed by GitHub
parent 76f0f9e386
commit 0c4e509b60
4 changed files with 71 additions and 5 deletions

View File

@@ -66,13 +66,16 @@ static bool VerifyElementContentParameters(StoryPageID page_id, StoryPageElement
break;
case SPET_BUTTON_PUSH:
if (!button_data.ValidateColour()) return false;
if (!button_data.ValidateFlags()) return false;
return true;
case SPET_BUTTON_TILE:
if (!button_data.ValidateColour()) return false;
if (!button_data.ValidateFlags()) return false;
if (!button_data.ValidateCursor()) return false;
return true;
case SPET_BUTTON_VEHICLE:
if (!button_data.ValidateColour()) return false;
if (!button_data.ValidateFlags()) return false;
if (!button_data.ValidateCursor()) return false;
if (!button_data.ValidateVehicleType()) return false;
return true;