示例#1
0
 object OnOvenToggle(BaseOven oven, BasePlayer player)
 {
     if (oven.needsBuildingPrivilegeToUse && !player.CanBuild())
     {
         return(null);
     }
     if (usePermissions && !permission.UserHasPermission(oven.OwnerID.ToString(), permAllow))
     {
         return(null);
     }
     if (!oven.HasFlag(BaseEntity.Flags.On))
     {
         object checkMultiplier = null;
         if (!ovenMultipliers.TryGetValue(oven.GetComponent <BaseEntity>().ShortPrefabName, out checkMultiplier))
         {
             return(null);
         }
         var ovenMultiplier = Convert.ToSingle(checkMultiplier);
         if (ovenMultiplier > 10f)
         {
             ovenMultiplier = 10f;
         }
         if (ovenMultiplier < 0.1f)
         {
             ovenMultiplier = 0.1f;
         }
         StartCooking(oven, oven.GetComponent <BaseEntity>(), ovenMultiplier);
         return(false);
     }
     return(null);
 }
示例#2
0
 object OnOvenToggle(BaseOven oven, BasePlayer player)
 {
     if (oven is BaseFuelLightSource || (oven.needsBuildingPrivilegeToUse && !player.CanBuild()))
     {
         return(null);
     }
     if (!oven.HasFlag(BaseEntity.Flags.On))
     {
         StartCooking(oven);
     }
     else
     {
         StopCooking(oven);
     }
     return(false);
 }