sickle: search with AtRect instead of InRect to not miss wide plants

Even when standing directly over a plant, you would sometimes not harvest it because its midpoint would be out of the Clonk's rectangle. Now the Clonk only has to touch plants.
shapetextures
David Dormagen 2015-10-30 08:27:44 +01:00
parent cb4dbc3609
commit 4b3db94e0b
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public func ControlUseStart(object clonk, int x, int y)
clonk->UpdateAttach();
// Search for harvestable plants
var crop = FindObject(Find_InRect(AbsX(clonk->GetX()-8), AbsY(clonk->GetY()-10), 16,20), Find_NoContainer(), Find_Func("SickleHarvesting"), Find_Func("IsHarvestable"));
var crop = FindObject(Find_AtRect(AbsX(clonk->GetX()-8), AbsY(clonk->GetY()-10), 16,20), Find_NoContainer(), Find_Func("SickleHarvesting"), Find_Func("IsHarvestable"));
if (crop)
crop->Harvest();