Complain if WorkshopUploadAppId not set

This commit is contained in:
Garry Newman 2018-07-20 12:02:18 +01:00
parent dc6b9fa5f7
commit 22dda179a3

View File

@ -112,6 +112,9 @@ private void StartCreatingItem()
if ( !Type.HasValue ) if ( !Type.HasValue )
throw new System.Exception( "Editor.Type must be set when creating a new item!" ); throw new System.Exception( "Editor.Type must be set when creating a new item!" );
if ( WorkshopUploadAppId == 0 )
throw new Exception( "WorkshopUploadAppId should not be 0" );
CreateItem = workshop.ugc.CreateItem( WorkshopUploadAppId, (SteamNative.WorkshopFileType)(uint)Type, OnItemCreated ); CreateItem = workshop.ugc.CreateItem( WorkshopUploadAppId, (SteamNative.WorkshopFileType)(uint)Type, OnItemCreated );
} }
@ -137,6 +140,9 @@ private void OnItemCreated( SteamNative.CreateItemResult_t obj, bool Failed )
private void PublishChanges() private void PublishChanges()
{ {
if ( WorkshopUploadAppId == 0 )
throw new Exception( "WorkshopUploadAppId should not be 0" );
UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id ); UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id );
if ( Title != null ) if ( Title != null )