forked from Mirrors/openclonk
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
parent
cb4dbc3609
commit
4b3db94e0b
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue