Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	EXILED.props
  • Loading branch information
joker-119 committed Mar 23, 2023
2 parents f469b00 + 049e7e8 commit 12c80de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<PropertyGroup>
<!-- This is the global version and is used for all projects that don't have a version -->
<Version Condition="$(Version) == ''">6.0.4</Version>
<Version Condition="$(Version) == ''">6.0.5</Version>
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
<PublicBeta>false</PublicBeta>

Expand Down
2 changes: 1 addition & 1 deletion Exiled.API/Features/DamageHandlers/DamageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DamageHandler(Player target, BaseHandler baseHandler)
Target = target;
Attacker = baseHandler is PlayerStatsSystem.AttackerDamageHandler handler ? Player.Get(handler.Attacker.Hub) : null;
TargetFootprint = target == null ? default : target.Footprint;
AttackerFootprint = baseHandler is PlayerStatsSystem.AttackerDamageHandler handle ? handle.Attacker : Attacker?.Footprint ?? default;
AttackerFootprint = baseHandler is PlayerStatsSystem.AttackerDamageHandler handle ? handle.Attacker : Attacker?.Footprint ?? TargetFootprint;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Exiled.CustomItems/API/Features/CustomWeapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected virtual void OnShot(ShotEventArgs ev)
/// <param name="ev"><see cref="HurtingEventArgs"/>.</param>
protected virtual void OnHurting(HurtingEventArgs ev)
{
if (ev.IsAllowed)
if (ev.IsAllowed && Damage > 0f)
ev.Amount = Damage;
}

Expand Down
10 changes: 1 addition & 9 deletions Exiled.Events/Patches/Fixes/GrenadePropertiesFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
LocalBuilder throwable = generator.DeclareLocal(typeof(ThrowableItem));
LocalBuilder projectile = generator.DeclareLocal(typeof(Projectile));
LocalBuilder playerCamera = generator.DeclareLocal(typeof(Transform));
LocalBuilder scale = generator.DeclareLocal(typeof(Vector3));

Label cnt = generator.DefineLabel();

Expand All @@ -56,7 +55,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
// baseProjectile.transform.rotation = this.Owner.PlayerCameraReference.rotation;
// baseProjectile.gameObject.SetActive(true);
// projectile.Spawned = true;
newInstructions.InsertRange(index, new CodeInstruction[]
newInstructions.InsertRange(index, new[]
{
// if (Item.Get(this) is Throwable throwable) goto cnt;
new CodeInstruction(OpCodes.Ldarg_0),
Expand All @@ -74,9 +73,6 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi

// Projectile projectile = throwable.Projectile;
new CodeInstruction(OpCodes.Ldloc_S, throwable.LocalIndex).WithLabels(cnt),
new(OpCodes.Callvirt, PropertyGetter(typeof(Throwable), nameof(Throwable.Scale))),
new(OpCodes.Stloc, scale.LocalIndex),
new(OpCodes.Ldloc_S, throwable.LocalIndex),
new(OpCodes.Callvirt, PropertyGetter(typeof(Throwable), nameof(Throwable.Projectile))),
new(OpCodes.Dup),

Expand Down Expand Up @@ -112,10 +108,6 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new(OpCodes.Ldloc_S, projectile.LocalIndex),
new(OpCodes.Ldc_I4_1),
new(OpCodes.Callvirt, PropertySetter(typeof(Projectile), nameof(Projectile.IsSpawned))),
new(OpCodes.Ldloc_S, projectile.LocalIndex),
new(OpCodes.Callvirt, PropertyGetter(typeof(ThrownProjectile), nameof(ThrownProjectile.transform))),
new(OpCodes.Ldloc, scale.LocalIndex),
new(OpCodes.Callvirt, PropertySetter(typeof(Transform), nameof(Transform.localScale))),
});

for (int z = 0; z < newInstructions.Count; z++)
Expand Down

0 comments on commit 12c80de

Please sign in to comment.