Adds missing feature flags
This commit is contained in:
parent
cb22c07cfb
commit
d728dea1a2
7 changed files with 27 additions and 21 deletions
|
|
@ -10,4 +10,5 @@ public static class ServerFeatureFlags
|
|||
public static bool PvPCombat { get; set; } = true;
|
||||
public static bool BankAccess { get; set; } = true;
|
||||
public static bool SpeedhackDetection { get; set; }
|
||||
public static bool InsuranceEnabled { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1884,7 +1884,7 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
|
|||
{
|
||||
list.Add(1049643); // cursed
|
||||
}
|
||||
else if (Insured)
|
||||
else if (ServerFeatureFlags.InsuranceEnabled && Insured)
|
||||
{
|
||||
list.Add(1061682); // <b>insured</b>
|
||||
}
|
||||
|
|
@ -4215,11 +4215,13 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
|
|||
Delete();
|
||||
}
|
||||
|
||||
public virtual bool CheckBlessed(Mobile m) => m_LootType == LootType.Blessed || Insured || m != null && m == BlessedFor;
|
||||
public virtual bool CheckBlessed(Mobile m) =>
|
||||
m_LootType == LootType.Blessed || ServerFeatureFlags.InsuranceEnabled && Insured || m != null && m == BlessedFor;
|
||||
|
||||
public virtual bool CheckNewbied() => m_LootType == LootType.Newbied;
|
||||
|
||||
public virtual bool IsStandardLoot() => !Insured && BlessedFor == null && m_LootType == LootType.Regular;
|
||||
public virtual bool IsStandardLoot() =>
|
||||
(!ServerFeatureFlags.InsuranceEnabled || !Insured) && BlessedFor == null && m_LootType == LootType.Regular;
|
||||
|
||||
public override string ToString() => $"{Serial} \"{GetType().Name}\"";
|
||||
|
||||
|
|
|
|||
|
|
@ -962,20 +962,21 @@ public static class FeatureFlagManager
|
|||
_ = key.ToLowerInvariant() switch
|
||||
{
|
||||
// Server project flags
|
||||
"player_trading" => ServerFeatureFlags.PlayerTrading = enabled,
|
||||
"pvp_combat" => ServerFeatureFlags.PvPCombat = enabled,
|
||||
"bank_access" => ServerFeatureFlags.BankAccess = enabled,
|
||||
"speedhack_detection" => ServerFeatureFlags.SpeedhackDetection = enabled,
|
||||
"player_trading" => ServerFeatureFlags.PlayerTrading = enabled,
|
||||
"pvp_combat" => ServerFeatureFlags.PvPCombat = enabled,
|
||||
"bank_access" => ServerFeatureFlags.BankAccess = enabled,
|
||||
"speedhack_detection" => ServerFeatureFlags.SpeedhackDetection = enabled,
|
||||
"insurance" => ServerFeatureFlags.InsuranceEnabled = enabled,
|
||||
|
||||
// UOContent flags
|
||||
"vendor_purchase" => ContentFeatureFlags.VendorPurchase = enabled,
|
||||
"vendor_sell" => ContentFeatureFlags.VendorSell = enabled,
|
||||
"player_vendors" => ContentFeatureFlags.PlayerVendors = enabled,
|
||||
"house_placement" => ContentFeatureFlags.HousePlacement = enabled,
|
||||
"boat_placement" => ContentFeatureFlags.BoatPlacement = enabled,
|
||||
"bulk_orders" => ContentFeatureFlags.BulkOrders = enabled,
|
||||
"passive_detect_hidden" => ContentFeatureFlags.PassiveDetectHidden = enabled,
|
||||
"young_player_system" => ContentFeatureFlags.YoungPlayerSystem = enabled,
|
||||
"vendor_purchase" => ContentFeatureFlags.VendorPurchase = enabled,
|
||||
"vendor_sell" => ContentFeatureFlags.VendorSell = enabled,
|
||||
"player_vendors" => ContentFeatureFlags.PlayerVendors = enabled,
|
||||
"house_placement" => ContentFeatureFlags.HousePlacement = enabled,
|
||||
"boat_placement" => ContentFeatureFlags.BoatPlacement = enabled,
|
||||
"bulk_orders" => ContentFeatureFlags.BulkOrders = enabled,
|
||||
"passive_detect_hidden" => ContentFeatureFlags.PassiveDetectHidden = enabled,
|
||||
"young_player_system" => ContentFeatureFlags.YoungPlayerSystem = enabled,
|
||||
"bitmap_pathfinding_cache" => ContentFeatureFlags.BitmapPathfindingCache = enabled,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ namespace Server.Engines.Insurance;
|
|||
|
||||
public static class Insurance
|
||||
{
|
||||
public static bool Enabled { get; private set; }
|
||||
public static bool Enabled => ServerFeatureFlags.InsuranceEnabled;
|
||||
private static Dictionary<Mobile, InsuranceContext> _insuranceContexts;
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
Enabled = ServerConfiguration.GetSetting("insurance.enable", Core.AOS);
|
||||
ServerFeatureFlags.InsuranceEnabled = ServerConfiguration.GetSetting("insurance.enable", Core.AOS);
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ public static class Insurance
|
|||
|
||||
public static bool CheckItemInsuranceOnDeath(PlayerMobile from, Item item)
|
||||
{
|
||||
if (!item.Insured)
|
||||
if (!Enabled || !item.Insured)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class ClothingBlessTarget : Target // Create our targeting class (which w
|
|||
}
|
||||
|
||||
// Check if its already newbied (blessed)
|
||||
if (item.LootType == LootType.Blessed || item.BlessedFor == from || item.Insured)
|
||||
if (item.LootType == LootType.Blessed || item.BlessedFor == from || Insurance.Enabled && item.Insured)
|
||||
{
|
||||
from.SendLocalizedMessage(1045113); // That item is already blessed
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Server.Collections;
|
||||
using Server.Engines.Insurance;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Mobiles;
|
||||
|
|
@ -23,7 +24,7 @@ public class DestroyEquipment : MonsterAbilitySingleTarget
|
|||
continue;
|
||||
}
|
||||
|
||||
if (item.Insured)
|
||||
if (Insurance.Enabled && item.Insured)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2397,7 +2397,8 @@ namespace Server.Mobiles
|
|||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private bool FindItems_Callback(Item item) =>
|
||||
!item.Deleted && (item.LootType == LootType.Blessed || item.Insured) && Backpack != item.Parent;
|
||||
!item.Deleted && Backpack != item.Parent &&
|
||||
(item.LootType == LootType.Blessed || ServerFeatureFlags.InsuranceEnabled && item.Insured);
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue