TSHOCKPLUGINS-9 #close fixed Fixed.

Workaround for REST meteor null reference exception crash. Requires an initializer for genRand if using any WorldGen methods in the future.
This commit is contained in:
Deathmax 2012-01-06 21:58:51 +08:00
parent 946bf2ad49
commit 714746ab6c

View file

@ -428,10 +428,10 @@ namespace TShockAPI
private object WorldMeteor(RestVerbs verbs, IParameterCollection parameters)
{
if (WorldGen.genRand == null)
WorldGen.genRand = new Random();
WorldGen.dropMeteor();
var returnBlock = new Dictionary<string, string>();
returnBlock.Add("status", "200");
returnBlock.Add("response", "Meteor has been spawned.");
var returnBlock = new Dictionary<string, string> {{"status", "200"}, {"response", "Meteor has been spawned."}};
return returnBlock;
}