Skip to content

Commit

Permalink
Make it compile on old C#
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 7, 2020
1 parent e463aac commit 5a203f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fCraft/Commands/CpeCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,13 @@ internal static string ParseModel(Player player, string model, bool isBot) {
model = model ?? "humanoid";
string scalestr = "";
int sepIndex = model.IndexOf('|');
float scale;

if (sepIndex >= 0) {
scalestr = model.Substring(sepIndex + 1);
model = model.Substring(0, sepIndex);
}
if (float.TryParse(scalestr, out float scale)) {
if (float.TryParse(scalestr, out scale)) {
if (player.Info.Rank == RankManager.HighestRank) {
if (isBot) { //Owner Bot scale between 0.01 and 128
if (scale < 0.01f) scale = 0.01f;
Expand Down
3 changes: 2 additions & 1 deletion fCraft/World/WorldManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ public static void ParseCPEMetaData(ref World world, Map map, string previousMap
}
}
if (File.Exists(blockDefPath)) {
BlockDefinition[] defs = BlockDefinition.Load(blockDefPath, out _);
int count;
BlockDefinition[] defs = BlockDefinition.Load(blockDefPath, out count);
for (int i = 0; i < defs.Length; i++) {
if (defs[i] == null) defs[i] = BlockDefinition.GlobalDefs[i];
}
Expand Down

0 comments on commit 5a203f6

Please sign in to comment.