Skip to content

Commit

Permalink
Add Debug Text for Incomplete Repairs
Browse files Browse the repository at this point in the history
- Adds additional debug message when the RepairFacility_ChatNotification preference is set to true
  • Loading branch information
data-bomb committed Sep 20, 2024
1 parent 7cf3123 commit cd25524
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Si_RepairFacility/Si_RepairFacility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You should have received a copy of the GNU General Public License
using System.Collections.Generic;
using System.Text;

[assembly: MelonInfo(typeof(RepairFacility), "Repair Facility", "1.1.0", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonInfo(typeof(RepairFacility), "Repair Facility", "1.1.1", "databomb", "https://github.com/data-bomb/Silica")]
[assembly: MelonGame("Bohemia Interactive", "Silica")]
[assembly: MelonOptionalDependencies("Admin Mod")]

Expand Down Expand Up @@ -99,6 +99,11 @@ private static void Postfix(MusicJukeboxHandler __instance)
float healAmount = vehicle.DamageManager.MaxHealth * (vehicle.IsFlyingType ? _Pref_Humans_Aircraft_HealRate.Value : _Pref_Humans_Vehicle_HealRate.Value);
float newHealth = Mathf.Clamp(vehicle.DamageManager.Health + healAmount, 0.0f, vehicle.DamageManager.MaxHealth);
vehicle.DamageManager.SetHealth(newHealth);

if (_Pref_Repair_Notification.Value && vehicle.ControlledBy != null)
{
HelperMethods.SendChatMessageToPlayer(vehicle.ControlledBy, HelperMethods.chatPrefix, " Debug Info: Health[" + vehicle.DamageManager.Health + "] MaxHP[" + vehicle.DamageManager.MaxHealth + "] HealAmt[" + healAmount + "]");
}
}
}
}
Expand Down

0 comments on commit cd25524

Please sign in to comment.