Skip to content

Commit

Permalink
Fix walking against boarded window bug
Browse files Browse the repository at this point in the history
Fix picking up broken items from containers
  • Loading branch information
bsarsgard committed Jul 17, 2021
1 parent aedbe6e commit 07b23c8
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions media/lua/client/2_Other/SuperSurvivor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1657,8 +1657,14 @@ function SuperSurvivor:update()
(
(self.TicksSinceSquareChanged > 6)
and (self:isInAction() == false)
and (
self:getCurrentTask() == "None"
or self:getCurrentTask() == "Find This"
or self:getCurrentTask() == "Find New Building"
)
) or (self:getCurrentTask() == "Pursue")
) then
print(self:getName().." Attempt Entry1")
self:getTaskManager():AddToTop(AttemptEntryIntoBuildingTask:new(self, self.TargetBuilding))
self.TicksSinceSquareChanged = 0
end
Expand Down Expand Up @@ -2651,14 +2657,26 @@ function SuperSurvivor:FindThisNearBy(itemType, TypeOrCategory)
--end
--print("FindCatResult: " .. tostring(FindCatResult))

if(tempDistance<closestSoFar) and ((TypeOrCategory == "Category") and (FindCatResult ~= nil)) or ((TypeOrCategory == "Type") and (container:FindAndReturn(itemType)) ~= nil) then
if(tempDistance<closestSoFar)
and (
(TypeOrCategory == "Category")
and (FindCatResult ~= nil)
) or (
(TypeOrCategory == "Type")
and (container:FindAndReturn(itemType)) ~= nil
) then

if (TypeOrCategory == "Category") then
itemtoReturn = FindCatResult
else
itemtoReturn = container:FindAndReturn(itemType)
end
closestSoFar = tempDistance

if itemtoReturn:isBroken() then
itemtoReturn = nil
else
closestSoFar = tempDistance
end

end
elseif(itemType == "Water") and (items:get(j):hasWater()) and (tempDistance<closestSoFar) then
Expand Down

0 comments on commit 07b23c8

Please sign in to comment.