Hello,
Your plugins was just amazing. But i have a few problems.
On "object OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info)"
A player who have building privilege can't destroy item if is not in hours protect:
//FIX : Building Privilège detect
if(info.InitiatorPlayer.CanBuild()) return null;
In hours protect, can't butcher scientist:
//FIX : Only Focus building block
if(!entity is BuildingBlock) return null;
Feature: user can break twings structure in hours protect
//FEATURE : Ignore twings can add a new config var
var block = entity as BuildingBlock;
if (block != null && block.grade == BuildingGrade.Enum.Twigs) return null;
On "public bool IsDamageControlOn()"
When hour protect exceeds 12:00 AM (exemple protect start at 11:00 PM and finish at 06:00 PM), the protection was not active after 12:00 AM
//FIX : Si heure début dépasse minuit
if(startTime < endTime)
{
DateTime minuit = DateTime.ParseExact("12:00 AM", "hh:mm tt", CultureInfo.InvariantCulture);
if( DateTime.Now.ToLocalTime() >= startTime &&
DateTime.Now.ToLocalTime() <= minuit ||
DateTime.Now.ToLocalTime() <= endTime &&
DateTime.Now.ToLocalTime() >= minuit)
{
return true;
}
}
Best regards, Barlaf.