From bb4462f607020fea2039b95d68c9e6709bf6c2ad Mon Sep 17 00:00:00 2001 From: Madpeter Date: Sun, 26 Apr 2020 01:38:12 +0100 Subject: [PATCH] updates setParcelFlag to use the new perm check function --- Core/Commands/Parcel/SetParcelFlag.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/Commands/Parcel/SetParcelFlag.cs b/Core/Commands/Parcel/SetParcelFlag.cs index 4e23900..97745b0 100644 --- a/Core/Commands/Parcel/SetParcelFlag.cs +++ b/Core/Commands/Parcel/SetParcelFlag.cs @@ -61,22 +61,22 @@ namespace BSB.Commands.CMD_Parcel { int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition); Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid]; - if (p.OwnerID != bot.GetClient.Self.AgentID) + if (parcel_static.has_parcel_perm(p, bot) == true) { - if (p.IsGroupOwned) + foreach (KeyValuePair cfg in setflags) { - bot.GetClient.Groups.ActivateGroup(p.GroupID); + if (flags.ContainsKey(cfg.Key) == true) + { + Dosetflag(flags[cfg.Key], p, cfg.Value); + } } + p.Update(bot.GetClient.Network.CurrentSim, false); + return true; } - foreach (KeyValuePair cfg in setflags) + else { - if (flags.ContainsKey(cfg.Key) == true) - { - Dosetflag(flags[cfg.Key], p, cfg.Value); - } + return Failed("Incorrect perms to control parcel"); } - p.Update(bot.GetClient.Network.CurrentSim, false); - return true; } else {