From f47e3f395a0c215abdf0d56c4893faca7072f648 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sun, 25 Oct 2020 12:26:42 -0500 Subject: [PATCH] Adds a sanity check so asset names cannot start with a number, which would be an invalid object name, --- .../BaseGame/game/tools/assetBrowser/scripts/newAsset.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs index e75be74de..dc46dcd2b 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs @@ -167,6 +167,13 @@ function CreateNewAsset() return; } + %firstChar = getSubStr(%assetName, 0, 1); + if(isInt(%firstChar)) + { + toolsMessageBoxOK( "Error", "Names cannot start with a number!"); + return; + } + //get the selected module data %moduleName = NewAssetTargetModule.getText();