Fix invis glitch
This commit is contained in:
parent
8c4401219c
commit
e50386084c
2 changed files with 87 additions and 78 deletions
|
|
@ -2447,7 +2447,7 @@ namespace TShockAPI
|
||||||
bool hasPermission = !TShock.CheckProjectilePermission(args.Player, index, type);
|
bool hasPermission = !TShock.CheckProjectilePermission(args.Player, index, type);
|
||||||
if (!TShock.Config.IgnoreProjUpdate && !hasPermission)
|
if (!TShock.Config.IgnoreProjUpdate && !hasPermission)
|
||||||
{
|
{
|
||||||
if ((type == 100) || (type > 289 && type < 298) || (type >= 325 && type <= 328))
|
if ((type == 100) || type == 261 || (type > 289 && type < 298) || (type >= 325 && type <= 328))
|
||||||
{
|
{
|
||||||
Log.Debug("Certain projectiles have been ignored for cheat detection.");
|
Log.Debug("Certain projectiles have been ignored for cheat detection.");
|
||||||
}
|
}
|
||||||
|
|
@ -3189,7 +3189,6 @@ namespace TShockAPI
|
||||||
|
|
||||||
private static bool HandlePlayerAnimation(GetDataHandlerArgs args)
|
private static bool HandlePlayerAnimation(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (OnPlayerAnimation())
|
if (OnPlayerAnimation())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1291,7 +1291,7 @@ namespace TShockAPI
|
||||||
sock.kill = true;
|
sock.kill = true;
|
||||||
using (var ms = new MemoryStream())
|
using (var ms = new MemoryStream())
|
||||||
{
|
{
|
||||||
new DisconnectMsg {Reason = str}.PackFull(ms);
|
new DisconnectMsg { Reason = str }.PackFull(ms);
|
||||||
SendBytesBufferless(sock, ms.ToArray());
|
SendBytesBufferless(sock, ms.ToArray());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -1311,8 +1311,9 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (e.MsgId == PacketTypes.WorldInfo)
|
else if (e.MsgId == PacketTypes.WorldInfo)
|
||||||
{
|
{
|
||||||
if (e.remoteClient == -1) return;
|
if (e.remoteClient == -1) return;
|
||||||
var player = Players[e.remoteClient];
|
var player = Players[e.remoteClient];
|
||||||
|
|
@ -1323,16 +1324,16 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
var msg = new WorldInfoMsg
|
var msg = new WorldInfoMsg
|
||||||
{
|
{
|
||||||
Time = (int) Main.time,
|
Time = (int)Main.time,
|
||||||
DayTime = Main.dayTime,
|
DayTime = Main.dayTime,
|
||||||
MoonPhase = (byte) Main.moonPhase,
|
MoonPhase = (byte)Main.moonPhase,
|
||||||
BloodMoon = Main.bloodMoon,
|
BloodMoon = Main.bloodMoon,
|
||||||
MaxTilesX = Main.maxTilesX,
|
MaxTilesX = Main.maxTilesX,
|
||||||
MaxTilesY = Main.maxTilesY,
|
MaxTilesY = Main.maxTilesY,
|
||||||
SpawnX = Main.spawnTileX,
|
SpawnX = Main.spawnTileX,
|
||||||
SpawnY = Main.spawnTileY,
|
SpawnY = Main.spawnTileY,
|
||||||
WorldSurface = (int) Main.worldSurface,
|
WorldSurface = (int)Main.worldSurface,
|
||||||
RockLayer = (int) Main.rockLayer,
|
RockLayer = (int)Main.rockLayer,
|
||||||
//Sending a fake world id causes the client to not be able to find a stored spawnx/y.
|
//Sending a fake world id causes the client to not be able to find a stored spawnx/y.
|
||||||
//This fixes the bed spawn point bug. With a fake world id it wont be able to find the bed spawn.
|
//This fixes the bed spawn point bug. With a fake world id it wont be able to find the bed spawn.
|
||||||
WorldID = Main.worldID,
|
WorldID = Main.worldID,
|
||||||
|
|
@ -1385,6 +1386,15 @@ namespace TShockAPI
|
||||||
player.SendRawData(ms.ToArray());
|
player.SendRawData(ms.ToArray());
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (e.MsgId == PacketTypes.PlayerHp)
|
||||||
|
{
|
||||||
|
if (Main.player[(byte)e.number].statLife <= 0)
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue