Hello everyone. I'm encountering an error: 'Too many parameters for TotalDamageResult method', and I can't understand what might be causing the issue.
Code:
modded class PlayerBase {
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef) {
Print("[DEBUG] EEHitBy called with ammo: " + ammo);
float baseDamage = damageResult.GetHighestDamage("Health");
float armorModifier = 1.0;
float projectileModifier = 1.0;
EntityAI entity = GetInventory().FindAttachment(InventorySlots.BODY);
if (entity) {
Print("[DEBUG] Player has armor: " + entity.GetType());
if (entity.IsKindOf("PlateCarrier")) {
if (ammo == "Custom_Bullet_545x39_HP") {
projectileModifier = 0.1;
Print("[DEBUG] Applied projectileModifier for PlateCarrier and HP ammo: " + projectileModifier);
} else if (ammo == "Custom_Bullet_545x39_PRS") {
projectileModifier = 0.5;
Print("[DEBUG] Applied projectileModifier for PlateCarrier and PRS ammo: " + projectileModifier);
}
} else if (entity.IsKindOf("Vest_Base")) {
projectileModifier = 1.0;
Print("[DEBUG] Applied projectileModifier for Vest_Base: " + projectileModifier);
}
} else {
Print("[DEBUG] Player has no armor.");
}
float finalDamage = baseDamage * armorModifier * projectileModifier;
Print("[DEBUG] Calculated finalDamage: " + finalDamage);
TotalDamageResult newDamageResult = new TotalDamageResult("", finalDamage, "", "", 0);
super.EEHitBy(newDamageResult, component, zone, ammo, modelPos, speedCoef);
Print("[DEBUG] EEHitBy completed.");
}
}