Fixed the minimum value that made the "Bouncer" not work properly

This commit is contained in:
AkjaHAsLk1IALk0MasH 2021-11-27 11:57:48 +07:00
parent 2f30ef20fd
commit 606b9e43d7

View file

@ -1083,12 +1083,17 @@ namespace TShockAPI
return; return;
} }
/*if (
(Projectile_MaxValuesAI.ContainsKey(type) &&
(Projectile_MinValuesAI[type] > ai[0] || ai[0] < Projectile_MaxValuesAI[type])) ||
(Projectile_MaxValuesAI2.ContainsKey(type) &&
(Projectile_MinValuesAI2[type] > ai[1] || Projectile_MaxValuesAI2[type] < ai[1]))
)*/
if ( if (
(Projectile_MaxValuesAI.ContainsKey(type) && (Projectile_MaxValuesAI.ContainsKey(type) &&
(ai[0] > Projectile_MaxValuesAI[type] || ai[0] < Projectile_MinValuesAI[type])) || (Projectile_MaxValuesAI[type] < ai[0] || Projectile_MinValuesAI[type] > ai[0])) ||
(Projectile_MaxValuesAI2.ContainsKey(type) && (Projectile_MaxValuesAI2.ContainsKey(type) &&
(ai[1] > Projectile_MaxValuesAI2[type] || ai[1] < Projectile_MinValuesAI2[type])) (Projectile_MaxValuesAI2[type] < ai[1] || Projectile_MinValuesAI2[type] > ai[1]))
) )
{ {
TShock.Log.ConsoleDebug("Bouncer / OnNewProjectile rejected from bouncer modified AI from {0}.", args.Player.Name); TShock.Log.ConsoleDebug("Bouncer / OnNewProjectile rejected from bouncer modified AI from {0}.", args.Player.Name);
@ -1097,6 +1102,8 @@ namespace TShockAPI
return; return;
} }
if (!args.Player.HasPermission(Permissions.ignoreprojectiledetection)) if (!args.Player.HasPermission(Permissions.ignoreprojectiledetection))
{ {
if (type == ProjectileID.CrystalShard && TShock.Config.Settings.ProjIgnoreShrapnel) // Ignore crystal shards if (type == ProjectileID.CrystalShard && TShock.Config.Settings.ProjIgnoreShrapnel) // Ignore crystal shards
@ -2524,8 +2531,8 @@ namespace TShockAPI
}; };
private Dictionary<short, float> Projectile_MinValuesAI2 = new Dictionary<short, float> { private Dictionary<short, float> Projectile_MinValuesAI2 = new Dictionary<short, float> {
{ 405, 0.8f }, { 405, 0f },
{ 410, 0.6f }, { 410, 0f },
{ 424, 0.5f }, { 424, 0.5f },
{ 425, 0.5f }, { 425, 0.5f },