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

This commit is contained in:
MarioE 2013-10-23 18:08:36 -04:00
commit 666ea54e1e
3 changed files with 19 additions and 5 deletions

View file

@ -2503,10 +2503,15 @@ namespace TShockAPI
return false;
}
if (id >= Main.maxPlayers)
{
return true;
}
if (OnKillMe(id, direction, dmg, pvp))
return true;
int textlength = (int) (args.Data.Length - args.Data.Position - 1);
int textlength = (int)(args.Data.Length - args.Data.Position - 1);
string deathtext = "";
if (textlength > 0)
{
@ -2882,6 +2887,12 @@ namespace TShockAPI
args.Player.SendData(PacketTypes.PlayerBuff, "", id);
return true;
}
if (id >= Main.maxPlayers)
{
return true;
}
if (!TShock.Players[id].TPlayer.hostile)
{
args.Player.SendData(PacketTypes.PlayerBuff, "", id);
@ -2988,8 +2999,10 @@ namespace TShockAPI
}*/
}
if (TShock.Players[id] == null)
if (id >= Main.maxPlayers || TShock.Players[id] == null)
{
return true;
}
if (dmg > TShock.Config.MaxDamage && !args.Player.Group.HasPermission(Permissions.ignoredamagecap) && id != args.Player.Index)
{
@ -3341,7 +3354,7 @@ namespace TShockAPI
return true;
}
if (Main.player[id] == null || TShock.Players[id] == null)
if (id >= Main.maxPlayers || Main.player[id] == null || TShock.Players[id] == null)
{
return true;
}

View file

@ -1150,7 +1150,7 @@ namespace TShockAPI
player.LastNetPosition = new Vector2(Main.spawnTileX*16f, Main.spawnTileY*16f);
if (Config.RememberLeavePos && (RememberedPos.GetLeavePos(player.Name, player.IP) != Vector2.Zero) && Config.ServerSideCharacter && Config.DisableLoginBeforeJoin)
if (Config.RememberLeavePos && (RememberedPos.GetLeavePos(player.Name, player.IP) != Vector2.Zero) && !player.LoginHarassed)
{
player.RPPending=3;
player.SendMessage("You will be teleported to your last known location...", Color.Red);

View file

@ -258,7 +258,7 @@ namespace TShockAPI
return found;
byte plrID;
if (byte.TryParse(plr, out plrID))
if (byte.TryParse(plr, out plrID) && plrID < Main.maxPlayers)
{
TSPlayer player = TShock.Players[plrID];
if (player != null && player.Active)
@ -592,6 +592,7 @@ namespace TShockAPI
TShock.HandleCommandLinePostConfigLoad(Environment.GetCommandLineArgs());
TShock.Groups.LoadPermisions();
TShock.Regions.ReloadAllRegions();
TShock.Itembans.UpdateItemBans();
Hooks.GeneralHooks.OnReloadEvent(player);
}