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:
parent
946bf2ad49
commit
714746ab6c
1 changed files with 4 additions and 4 deletions
|
|
@ -428,10 +428,10 @@ namespace TShockAPI
|
||||||
|
|
||||||
private object WorldMeteor(RestVerbs verbs, IParameterCollection parameters)
|
private object WorldMeteor(RestVerbs verbs, IParameterCollection parameters)
|
||||||
{
|
{
|
||||||
|
if (WorldGen.genRand == null)
|
||||||
|
WorldGen.genRand = new Random();
|
||||||
WorldGen.dropMeteor();
|
WorldGen.dropMeteor();
|
||||||
var returnBlock = new Dictionary<string, string>();
|
var returnBlock = new Dictionary<string, string> {{"status", "200"}, {"response", "Meteor has been spawned."}};
|
||||||
returnBlock.Add("status", "200");
|
|
||||||
returnBlock.Add("response", "Meteor has been spawned.");
|
|
||||||
return returnBlock;
|
return returnBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue