Dear uMod community,
I was wondering if there is a way to somehow hook changes in upkeep time?
As I noticed there wasn't a real hook for upkeep changes, I have tried to use a less optimal way where I use the OnLootEntityEnd hook like this:
void OnLootEntityEnd(BasePlayer player, BaseCombatEntity entity)
{
if(entity.ShortPrefabName == "cupboard.tool.deployed") {
BuildingPrivlidge priv = entity.GetBuildingPrivilege();
float minutesLeft = priv.GetProtectedMinutes();
string minutes = minutesLeft.ToString();
Puts(minutes);
}
}But this code returns the wrong upkeep time in minutes when you close out on the toolcupboard inventory before the new upkeep time has been calculated.
I hope someone is able to point me in the right direction.
That would be much appreciated.
Best regards,
Elephant47