Moved the else from Midas' commit that reset the groups allowed in the event of an error, we can just ignore it instead of resetting. Move initialization of the list to the constructor.
This commit is contained in:
parent
77af896427
commit
d92537fd87
1 changed files with 4 additions and 7 deletions
|
|
@ -618,6 +618,7 @@ namespace TShockAPI.DB
|
|||
DisableBuild = true;
|
||||
WorldID = string.Empty;
|
||||
AllowedIDs = new List<int>();
|
||||
AllowedGroups = new List<string>();
|
||||
}
|
||||
|
||||
public bool InArea(Rectangle point)
|
||||
|
|
@ -662,8 +663,8 @@ namespace TShockAPI.DB
|
|||
AllowedIDs = id_list;
|
||||
}
|
||||
|
||||
public void SetAllowedGroups( String groups )
|
||||
{
|
||||
public void SetAllowedGroups( String groups )
|
||||
{
|
||||
// prevent null pointer exceptions
|
||||
if (!string.IsNullOrEmpty(groups))
|
||||
{
|
||||
|
|
@ -674,11 +675,7 @@ namespace TShockAPI.DB
|
|||
|
||||
AllowedGroups = groupArr;
|
||||
}
|
||||
else
|
||||
{
|
||||
AllowedGroups = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveID(int id)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue