Add DisableTombstones

This commit is contained in:
Deathmax 2011-12-04 15:55:20 +08:00
parent 77b9fcaf98
commit 28c4f9ed9c
3 changed files with 13 additions and 2 deletions

View file

@ -199,6 +199,9 @@ namespace TShockAPI
[Description("This is the port which the rest api will listen on.")]
public int RestApiPort = 7878;
[Description("Disable tombstones for all players.")]
public bool DisableTombstones = true;
public static ConfigFile Read(string path)
{
if (!File.Exists(path))

View file

@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3.4.1203")]
[assembly: AssemblyFileVersion("3.3.4.1203")]
[assembly: AssemblyVersion("3.3.4.1204")]
[assembly: AssemblyFileVersion("3.3.4.1204")]

View file

@ -195,6 +195,7 @@ namespace TShockAPI
NetHooks.SendData += NetHooks_SendData;
NetHooks.GreetPlayer += OnGreetPlayer;
NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc;
ProjectileHooks.SetDefaults += OnProjectileSetDefaults;
GetDataHandlers.InitGetDataHandler();
Commands.InitCommands();
@ -707,6 +708,13 @@ namespace TShockAPI
}
}
void OnProjectileSetDefaults(SetDefaultsEventArgs<Projectile, int> e)
{
if (e.Info == 43)
if (Config.DisableTombstones)
e.Object.SetDefaults(0);
}
/// <summary>
/// Send bytes to client using packetbuffering if available
/// </summary>