Browse Source

Merge pull request #3699 from asteinwedel/csharp-json-parse

C# Correct how to type cast Dictionaries returned from JSONParseResult
Rémi Verschelde 5 years ago
parent
commit
c7391a7e56
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tutorials/io/saving_games.rst

+ 1 - 1
tutorials/io/saving_games.rst

@@ -267,7 +267,7 @@ load function:
         while (saveGame.GetPosition() < save_game.GetLen())
         {
             // Get the saved dictionary from the next line in the save file
-            var nodeData = (Godot.Collections.Dictionary<string, object>)JSON.Parse(saveGame.GetLine()).Result;
+            var nodeData = new Godot.Collections.Dictionary<string, object>((Godot.Collections.Dictionary)JSON.Parse(saveGame.GetLine()).Result);
 
             // Firstly, we need to create the object and add it to the tree and set its position.
             var newObjectScene = (PackedScene)ResourceLoader.Load(nodeData["Filename"].ToString());