ソースを参照

Fix warning for followTargets not being a table

Alex Peterson 2 年 前
コミット
77318cc395
1 ファイル変更1 行追加5 行削除
  1. 1 5
      Project/Scripts/DynamicAppleSpawner.lua

+ 1 - 5
Project/Scripts/DynamicAppleSpawner.lua

@@ -17,7 +17,7 @@ function DynamicAppleSpawner:OnActivate()
     self.numPrefabsToSpawn = 0 -- don't spawn prefabs until a follow target exists
     self.numPrefabsSpawned = 0
     self.closestAppleTrees = {}
-    self.followTargets = nil
+    self.followTargets = {}
     self.freeAppleGroups = {}
     self.spawningPrefabs = false
 
@@ -65,10 +65,6 @@ end
 
 function DynamicAppleSpawner:AddFollowTarget(entityId)
     -- add a follow target that we will spawn apples around
-    if self.followTargets == nil then
-        self.followTargets = {}
-    end
-
     self.followTargets[tostring(entityId)] = {
         position = Vector3(0, 0, 0),
         update = false,