Handle ProjectileNew packet with a short type, not byte type
Fixes golden bullets, heat rays, rainbow guns, etc.
This commit is contained in:
parent
ff1f1059c0
commit
8175b21929
1 changed files with 4 additions and 4 deletions
|
|
@ -591,7 +591,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Type of projectile
|
/// Type of projectile
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte Type { get; set; }
|
public short Type { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ???
|
/// ???
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -602,7 +602,7 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<NewProjectileEventArgs> NewProjectile;
|
public static HandlerList<NewProjectileEventArgs> NewProjectile;
|
||||||
|
|
||||||
private static bool OnNewProjectile(short ident, Vector2 pos, Vector2 vel, float knockback, short dmg, byte owner, byte type, int index)
|
private static bool OnNewProjectile(short ident, Vector2 pos, Vector2 vel, float knockback, short dmg, byte owner, short type, int index)
|
||||||
{
|
{
|
||||||
if (NewProjectile == null)
|
if (NewProjectile == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2317,7 +2317,7 @@ namespace TShockAPI
|
||||||
var knockback = args.Data.ReadSingle();
|
var knockback = args.Data.ReadSingle();
|
||||||
var dmg = args.Data.ReadInt16();
|
var dmg = args.Data.ReadInt16();
|
||||||
var owner = args.Data.ReadInt8();
|
var owner = args.Data.ReadInt8();
|
||||||
var type = args.Data.ReadInt8();
|
var type = args.Data.ReadInt16();
|
||||||
owner = (byte)args.Player.Index;
|
owner = (byte)args.Player.Index;
|
||||||
var index = TShock.Utils.SearchProjectile(ident, owner);
|
var index = TShock.Utils.SearchProjectile(ident, owner);
|
||||||
|
|
||||||
|
|
@ -2353,7 +2353,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 == 39 || type == 40 || type == 38)
|
if (type == 100 || type == 294 || type == 295 || type == 296)
|
||||||
{
|
{
|
||||||
Log.Debug("Certain projectiles have been ignored for cheat detection.");
|
Log.Debug("Certain projectiles have been ignored for cheat detection.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue