Merge branch 'master' of github.com:TShock/TShock into general-devel

This commit is contained in:
high 2011-06-28 10:31:57 -04:00
commit 03ed7b8d81
5 changed files with 23 additions and 14 deletions

View file

@ -120,7 +120,7 @@ namespace TShockAPI
ChatCommands.Add(new Command("home", "tp", Home));
ChatCommands.Add(new Command("spawn", "tp", Spawn));
ChatCommands.Add(new Command("tp", "tp", TP));
ChatCommands.Add(new Command("tphere", "tp", TPHere));
ChatCommands.Add(new Command("tphere", "tphere", TPHere));
ChatCommands.Add(new Command("warp", "warp", UseWarp));
ChatCommands.Add(new Command("setwarp", "managewarp", SetWarp));
ChatCommands.Add(new Command("delwarp", "managewarp", DeleteWarp));

View file

@ -397,7 +397,10 @@ namespace TShockAPI
private static bool HandlePlayerDamage(GetDataHandlerArgs args)
{
byte playerid = args.Data.ReadInt8();
return !TShock.Players[playerid].TPlayer.hostile;
if (playerid >= 0 && playerid <= Main.maxPlayers && TShock.Players[playerid] != null)
return !TShock.Players[playerid].TPlayer.hostile;
return ConfigurationManager.PermaPvp;
}
private static bool HandleLiquidSet(GetDataHandlerArgs args)

View file

@ -143,8 +143,9 @@ namespace TShockAPI
Main.spawnTileX = tileX;
Main.spawnTileY = tileY;
SendData(PacketTypes.WorldInfo);
SendTileSquare(tileX, tileY, 30);
if (TPlayer.SpawnX >= 0 && TPlayer.SpawnY >= 0)
SendTileSquare(tileX, tileY, 50);
if (TPlayer.SpawnX > 0 && TPlayer.SpawnY > 0)
{
Main.tile[TPlayer.SpawnX, TPlayer.SpawnY].active = false;
NetMessage.SendTileSquare(Index, TPlayer.SpawnX, TPlayer.SpawnY, 1);
@ -157,6 +158,7 @@ namespace TShockAPI
{
Spawn();
}
Main.spawnTileX = spawnTileX;
Main.spawnTileY = spawnTileY;
SendData(PacketTypes.WorldInfo);

View file

@ -199,23 +199,26 @@ namespace TShockAPI
{
if (player != null && player.Active)
{
if (player.TileThreshold >= ConfigurationManager.TileThreshold)
if (player.TilesDestroyed != null)
{
if (Tools.HandleTntUser(player, "Kill tile abuse detected."))
if (player.TileThreshold >= ConfigurationManager.TileThreshold)
{
TSPlayer.Server.RevertKillTile(player.TilesDestroyed);
if (Tools.HandleTntUser(player, "Kill tile abuse detected."))
{
TSPlayer.Server.RevertKillTile(player.TilesDestroyed);
}
else if (player.TileThreshold > 0)
{
player.TileThreshold = 0;
player.TilesDestroyed.Clear();
}
}
else if (player.TileThreshold > 0)
{
player.TileThreshold = 0;
player.TilesDestroyed.Clear();
}
}
else if (player.TileThreshold > 0)
{
player.TileThreshold = 0;
player.TilesDestroyed.Clear();
}
if (!player.Group.HasPermission("usebanneditem"))

View file

@ -21,6 +21,7 @@
#spawnboss - allow player to spawn bosses
#spawnmob - allow player to spawn any npcs
#tp - allow player to teleport
#tphere - allow a player to teleport players to their position
#managewarp - allow player to add/delete warp locations
#editspawn - allow player to enable/disable build protection
#cfg - allow player to view/change tshock configuration
@ -39,5 +40,5 @@
default null canwater canlava warp
vip default reservedslot
newadmin default kick editspawn reservedslot
admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick
admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick tphere
trustedadmin admin maintenance cfg butcher cheat immunetoban ignorecheatdetection ignoregriefdetection usebanneditem