فهرست منبع

fix some bugs

Kolja Strohm 1 روز پیش
والد
کامیت
d36b21913d

+ 2 - 2
FactoryCraft/ChatCommand.cpp

@@ -40,7 +40,7 @@ void ChatCommand::addAutocompletePossibilities(
     if (possibilities.getEintragAnzahl() == 0
         || (possibilities.getEintragAnzahl() == 1 && appendToLast
             && possibilities.z(0)->istGleich(
-                args.get(args.getEintragAnzahl() - 1))))
+                *args.z(args.getEintragAnzahl() - 1))))
     {
         Framework::Text help = getHelp();
         while (help.hat("\n"))
@@ -139,7 +139,7 @@ Framework::RCArray<Framework::Text> ChatCommandParameter::getAutocompleteValues(
 
 PlayerNameParameter::PlayerNameParameter()
     : ChatCommandParameter(
-        "player", "The name of the player (has to be online)", 0)
+          "player", "The name of the player (has to be online)", 0)
 {}
 
 bool PlayerNameParameter::isLegalValue(Framework::Text value) const

+ 4 - 2
FactoryCraft/Chunk.cpp

@@ -1274,7 +1274,8 @@ void Chunk::onEntityEnters(Entity* zEntity, Chunk* lastChunk)
                 msg->addEntityMessage(zEntity);
                 if (msg->isEmpty()) break;
             }
-            observer->sendMessage(msg);
+            observer->sendMessage(
+                dynamic_cast<NetworkMessage*>(msg->getThis()));
         }
     }
     if (msg) msg->release();
@@ -1293,7 +1294,8 @@ void Chunk::onEntityLeaves(Entity* zEntity, Chunk* zNextChunk)
                 msg->removeEntityMessage(zEntity);
                 if (msg->isEmpty()) break;
             }
-            observer->sendMessage(msg);
+            observer->sendMessage(
+                dynamic_cast<NetworkMessage*>(msg->getThis()));
         }
     }
     if (msg) msg->release();

+ 2 - 2
FactoryCraft/GeneratorRule.cpp

@@ -31,9 +31,9 @@ void GeneratorRule::initialize(JExpressionMemory* zMemory)
 bool GeneratorRule::checkCondition(
     int x, int y, int z, JExpressionMemory* zMemory)
 {
-    if ((topLayer.getLength() && y > zMemory->getFloatVariable(topLayer))
+    if ((topLayer.getLength() && z > zMemory->getFloatVariable(topLayer))
         || (bottomLayer.getLength()
-            && y < zMemory->getFloatVariable(bottomLayer)))
+            && z < zMemory->getFloatVariable(bottomLayer)))
     {
         return false;
     }

+ 2 - 2
FactoryCraft/GeneratorRule.h

@@ -74,12 +74,12 @@ public:
         if (zJson->hasValue("bottomLayer"))
         {
             zRule->setBottomLayer(
-                (float)zJson->zValue("bottomLayer")->asString()->getString());
+                zJson->zValue("bottomLayer")->asString()->getString());
         }
         if (zJson->hasValue("topLayer"))
         {
             zRule->setTopLayer(
-                (float)zJson->zValue("topLayer")->asString()->getString());
+                zJson->zValue("topLayer")->asString()->getString());
         }
         return result;
     }

+ 2 - 2
FactoryCraft/ItemFilter.cpp

@@ -562,7 +562,7 @@ bool GroupItemFilter::matchItem(const Item* zItem) const
     {
         for (Framework::Text* typeGroup : zItem->zItemType()->getGroups())
         {
-            if (typeGroup->istGleich(group)) return true;
+            if (typeGroup->istGleich(*group)) return true;
         }
     }
     return false;
@@ -581,7 +581,7 @@ Framework::Text GroupItemFilter::getLogicUIML() const
                 for (Framework::Text* typeGroup :
                     Game::INSTANCE->zItemType(i)->getGroups())
                 {
-                    if (typeGroup->istGleich(group))
+                    if (typeGroup->istGleich(*group))
                     {
                         found = true;
                         break;

+ 3 - 1
FactoryCraft/Start.cpp

@@ -123,7 +123,9 @@ int main()
 #endif
     Zeit* z = getZeit();
     Text* pfad = new Text("log/");
-    pfad->append(z->getZeit("y-m-d_h-i-s.log"));
+    Text* tmp = z->getZeit("y-m-d_h-i-s.log");
+    pfad->append(*tmp);
+    tmp->release();
     z->release();
     Datei* logFile = new Datei(pfad);
     Logging::LoggingChannel* fileLogger

+ 35 - 18
Windows Version/data/items/itemTypes.json

@@ -1,19 +1,17 @@
 [
-    {
-
-        "type": "basic",
-        
-        "name": "Wooden Stick",
-        "model": {
-            "modelPath": "items.m3/stick",
-            "texturePaths": [
-                "items.ltdb/stick.png"
-            ]
-        },
-        "itemName": "Wooden Stick",
-        "hp": 1,
-        "durability": 10
+  {
+    "type": "basic",
+    "name": "Wooden Stick",
+    "model": {
+      "modelPath": "items.m3/stick",
+      "texturePaths": [
+        "items.ltdb/stick.png"
+      ]
     },
+    "itemName": "Wooden Stick",
+    "hp": 1,
+    "durability": 10
+  },
   {
     "type": "basic",
     "name": "Resin",
@@ -122,7 +120,9 @@
         {
           "targetFilter": {
             "type": "types",
-            "typeNames": [ "Dirt" ]
+            "typeNames": [
+              "Dirt"
+            ]
           },
           "replacementBlockType": "Farmland"
         }
@@ -149,7 +149,9 @@
         {
           "targetFilter": {
             "type": "groups",
-            "groupNames": [ "Shovel" ]
+            "groupNames": [
+              "Shovel"
+            ]
           }
         }
       ]
@@ -175,7 +177,9 @@
         {
           "targetFilter": {
             "type": "groups",
-            "groupNames": [ "Wood" ]
+            "groupNames": [
+              "Wood"
+            ]
           }
         }
       ]
@@ -226,8 +230,21 @@
       "direction": "bottom",
       "filter": {
         "type": "types",
-        "typeNames": [ "Farmland" ]
+        "typeNames": [
+          "Farmland"
+        ]
       }
     }
+  },
+  {
+    "type": "basic",
+    "name": "Tree bark",
+    "model": {
+      "modelPath": "items.m3/treebark",
+      "texturePaths": [
+        "items.ltdb/treebark.png"
+      ]
+    },
+    "itemName": "Tree bark"
   }
 ]