浏览代码

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,