Incorrect Error Message When Attempting to Paste Grid in World With Copy and Paste Off

WesternGamer shared this bug 21 months ago
Reported

I ran into a issue a few days ago where I thought the game was broken when I was unable to paste in creative mode. It showed an error like the one below. (The header should be changed to ERROR by the way.)

d21daf3c713e1a1792dde7ec6f8ed595The error message showed up even though I was in creative mode and this confused me until I realized that copy and paste was disabled in the world. I hope that this issue gets fixed so other people don't get confused in the future.


Technical info (And a way to fix this):

The code responsible to show this error message is in MyClipboardComponent.HandleGameInput(). The code below that showed the error screen above only checks if the player does not have creative mode tools and if copy and paste is disabled (in case of a creative mode world), which explains the confusing message. The check below can be changed to check if MySession.Static.SurvivalMode is true, and if MySession.Static.HasCreativeRights is false for singleplayer or if MySession.Static.CreativeToolsEnabled(Sync.MyId) is false in the case of a multiplayer world.

082e3064cdcbe6c511e6a64e348ea867

Another check after can be added to to check if MySession.Static.Settings.EnableCopyPaste is false and if MySession.HasCreativeRights is true for singleplayer or if MySession.Static.CreativeToolsEnabled(Sync.MyId)is true in the case of a multiplayer world to show a error screen stating that copy and paste is disabled.

Replies (2)

photo
1

I am unable to edit the original post as my editing permissions were revoked (probably due to many edits on the technical section.


Here is the code to replace the code above to fix this issue:

if (MySession.Static.SurvivalMode && (!MySession.Static.HasCreativeRights || !MySession.Static.CreativeToolsEnabled(Sync.MyId)) && !(MySession.Static.ControlledEntity is MyShipController) && MyInput.Static.IsNewKeyPressed(MyKeys.V) && MyInput.Static.IsAnyCtrlKeyPressed() && !MyInput.Static.IsAnyShiftKeyPressed())
			{
				MyClipboardComponent.ShowCannotPasteWarning();
			}
			if (MySession.Static.CreativeMode && !MySession.Static.Settings.EnableCopyPaste && (!MySession.Static.HasCreativeRights || !MySession.Static.CreativeToolsEnabled(Sync.MyId)) && !(MySession.Static.ControlledEntity is MyShipController) && MyInput.Static.IsNewKeyPressed(MyKeys.V) && MyInput.Static.IsAnyCtrlKeyPressed() && !MyInput.Static.IsAnyShiftKeyPressed())
			{
				MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(MyMessageBoxStyleEnum.Error, MyMessageBoxButtonsType.OK, new StringBuilder("Copy and paste is disabled in world settings, please enable this feature in world settings in order to use it."), MyTexts.Get(MyCommonTexts.Error), null, null, null, null, null, 0, MyGuiScreenMessageBox.ResultEnum.YES, true, null, true, null, true, false, null));
			}


The new last check should also include a check if MySession.Static.CreativeMode is true.

photo
2

Hello, Engineer!


Thank you for your report and a proposed fix! I reproduced this issue and reported it internally.


Kind regards,

Keen Software House, QA Department

Leave a Comment
 
Attach a file