Updated the GodMode field.
* Changed the GodMode field to a property that is controlled by the journey mode. - Removed the call to godmode in `Commands.ToggleGodMode`.
This commit is contained in:
parent
c67d5cf152
commit
6d4682ed7e
2 changed files with 9 additions and 6 deletions
|
|
@ -6740,10 +6740,6 @@ namespace TShockAPI
|
|||
|
||||
playerToGod.GodMode = !playerToGod.GodMode;
|
||||
|
||||
var godPower = CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>();
|
||||
|
||||
godPower.SetEnabledState(playerToGod.Index, playerToGod.GodMode);
|
||||
|
||||
if (playerToGod != args.Player)
|
||||
{
|
||||
args.Player.SendSuccessMessage(playerToGod.GodMode
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ using TShockAPI.Hooks;
|
|||
using TShockAPI.Net;
|
||||
using Timer = System.Timers.Timer;
|
||||
using System.Linq;
|
||||
using Terraria.GameContent.Creative;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -935,9 +936,15 @@ namespace TShockAPI
|
|||
public bool LoginHarassed = false;
|
||||
|
||||
/// <summary>
|
||||
/// Player cant die, unless onehit
|
||||
/// Controls the journey godmode
|
||||
/// </summary>
|
||||
public bool GodMode = false;
|
||||
public bool GodMode
|
||||
{
|
||||
get =>
|
||||
CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>().IsEnabledForPlayer(Index);
|
||||
set =>
|
||||
CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>().SetEnabledState(Index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Players controls are inverted if using SSC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue