Added support for animating resource container when harvesting

This commit is contained in:
Pali Rohár 2011-05-28 02:52:52 +02:00
parent 568a42bdeb
commit f2e8a3b060

View file

@ -344,6 +344,10 @@ static int GatherResource(CUnit &unit)
int i;
int addload;
if (!resinfo->HarvestFromOutside && unit.Container != NULL) {
unit.Container->SubAction = SUB_GATHER_RESOURCE;
UnitShowAnimation(*unit.Container, unit.Container->Type->Animations->Harvest[unit.CurrentResource]);
}
if (resinfo->HarvestFromOutside || resinfo->TerrainHarvester) {
AnimateActionHarvest(unit);
@ -534,6 +538,9 @@ static int StopGathering(CUnit &unit)
source->Data.Resource.Active--;
Assert(source->Data.Resource.Active >= 0);
if (!resinfo->HarvestFromOutside && source->Data.Resource.Active == 0)
source->SubAction = 1;
//Store resource position.
//source->RefsIncrease();
//unit.Orders[0]->Arg1.Resource.Mine = source;