فهرست منبع

fix fluid container not working properly

Kolja Strohm 9 ماه پیش
والد
کامیت
208e445704
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 1 1
      FactoryCraft/Entity.cpp
  2. 4 3
      FactoryCraft/FluidContainer.cpp

+ 1 - 1
FactoryCraft/Entity.cpp

@@ -585,7 +585,7 @@ ItemSkill* Entity::zSkill(int itemType)
 {
     for (ItemSkill* skill : skills)
     {
-        if (skill->getItemTypeId() == typeId)
+        if (skill->getItemTypeId() == itemType)
         {
             return skill;
         }

+ 4 - 3
FactoryCraft/FluidContainer.cpp

@@ -363,7 +363,7 @@ bool FluidContainerItemSkill::use(
         usedConfig = invalidUseConfig;
         invalid = true;
     }
-    else if (usedItem->getAmount() + 1000 <= usedItemType->getMaxFluidAmount())
+    else if (usedItem->getAmount() + 1000 > usedItemType->getMaxFluidAmount())
     {
         usedConfig = invalidUseConfig;
         invalid = true;
@@ -511,7 +511,8 @@ void FluidContainerItemSkillFactory::toJson(FluidContainerItemSkill* zObject,
 JSONObjectValidationBuilder* FluidContainerItemSkillFactory::addToValidator(
     JSONObjectValidationBuilder* builder) const
 {
-    return builder->withRequiredNumber("invalidUseStaminaCost")
+    return ItemSkillFactoryBase::addToValidator(builder)
+        ->withRequiredNumber("invalidUseStaminaCost")
         ->whichIsGreaterOrEqual(0.0)
         ->withDefault(0.5)
         ->finishNumber()
@@ -519,7 +520,7 @@ JSONObjectValidationBuilder* FluidContainerItemSkillFactory::addToValidator(
         ->whichIsGreaterOrEqual(0.0)
         ->withDefault(0.9)
         ->finishNumber()
-        ->withRequiredNumber("sinvalidUseStaminaCostDeviderPerLevel")
+        ->withRequiredNumber("invalidUseStaminaCostDeviderPerLevel")
         ->whichIsGreaterOrEqual(0.0)
         ->withDefault(0.1)
         ->finishNumber()