Add perm check for EoL + Sundial ForceTime check
If the player does not have permission to summon bosses, they should not be able to kill Prismatic Lacewing, which summons the Empress of Light. Using the Enchanted Sundial while ForceTime is set to day or night (via config) will conflict with TShock's continued attempts to set it back to day or night, this makes the world appear very glitchy.
This commit is contained in:
parent
c5421460ae
commit
65bbd80ca6
1 changed files with 22 additions and 6 deletions
|
|
@ -2809,10 +2809,17 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to hurt Town NPCs.");
|
||||
args.Player.SendData(PacketTypes.NpcUpdate, "", id);
|
||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandleNpcStrike rejected npc strike {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug($"GetDataHandlers / HandleNpcStrike rejected npc strike {args.Player.Name}");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Main.npc[id].netID == NPCID.EmpressButterfly && !args.Player.HasPermission(Permissions.summonboss))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to summon the Empress of Light.");
|
||||
args.Player.SendData(PacketTypes.NpcUpdate, "", id);
|
||||
TShock.Log.ConsoleDebug($"GetDataHandlers / HandleNpcStrike rejected EoL summon from {args.Player.Name}");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -3201,11 +3208,20 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
|
||||
if (type == 3 && !args.Player.HasPermission(Permissions.usesundial))
|
||||
if (type == 3)
|
||||
{
|
||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpecial rejected enchanted sundial permission {0}", args.Player.Name);
|
||||
args.Player.SendErrorMessage("You do not have permission to use the Enchanted Sundial.");
|
||||
return true;
|
||||
if (!args.Player.HasPermission(Permissions.usesundial))
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"GetDataHandlers / HandleSpecial rejected enchanted sundial permission {args.Player.Name}");
|
||||
args.Player.SendErrorMessage("You do not have permission to use the Enchanted Sundial.");
|
||||
return true;
|
||||
}
|
||||
else if (TShock.Config.Settings.ForceTime != "normal")
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"GetDataHandlers / HandleSpecial rejected enchanted sundial permission (ForceTime) { args.Player.Name}");
|
||||
args.Player.SendErrorMessage($"You must set ForceTime to normal via config to use the Enchanted Sundial.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue