MegaGlest Forum

Archives (read only) => Vanilla Glest => Bug report => Topic started by: will on 16 March 2011, 07:53:26

Title: Worker animation doesn't match the resource
Post by: will on 16 March 2011, 07:53:26
There is a bug I've noticed generally that, when you move a worker that has harvested something, and then you tell them to harvest something else, they first return to the castle with the wrong type of resource animation.
Title: Worker animation doesn't match the resource
Post by: ultifd on 16 March 2011, 08:01:55
There is a bug I've noticed generally that, when you move a worker that has harvested something, and then you tell them to harvest something else, they first return to the castle with the wrong type of resource animation.
Yes, that bug is very old...Glest and MG has it too. Maybe that could be fixed during the merge.
Title: Re: Worker animation doesn't match the resource
Post by: hailstone on 16 March 2011, 08:20:35
I split this off since it should really be a separate topic but I'm not sure how to move it out of feature requests.
Title: Re: Worker animation doesn't match the resource
Post by: ultifd on 16 March 2011, 08:30:15
OK, I moved it to the general bug report; since this bug applies to all versions of Glest.
Title: Re: Worker animation doesn't match the resource
Post by: -Archmage- on 16 March 2011, 08:32:20
It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D
Title: Re: Worker animation doesn't match the resource
Post by: will on 16 March 2011, 08:47:46
also consider what's the right thing to do - you have a worker who is carrying some amount of some harvested resource.

You explicitly move them.  They do not show visually that they are carrying any resource, they show a normal walking and then idle animation.  You then ask them to continue harvesting something else, and suddenly they are shown carrying a resource again!  Its a bit inconsistent?

What should the proper behaviour be?
Title: Re: Worker animation doesn't match the resource
Post by: -Archmage- on 16 March 2011, 10:12:21
Quote from: Will
What should the proper behaviour be?

It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D

 :| I believe that would carry on to affect ALL the workers movement?
Title: Re: Worker animation doesn't match the resource
Post by: ultifd on 16 March 2011, 22:13:06
It should use a loaded animation based on what resource the worker is carrying not on what skill is active. I think that should fix it. ;D
Sounds good, although if it was that easy...why wasn't this fixed when GAE and MG was first released?  :-X
I mean, this happens in almost every game I play for me...
Title: Re: Worker animation doesn't match the resource
Post by: John.d.h on 16 March 2011, 22:19:07
It's probably just an oversight that nobody bothered to write down and fix.
Title: Re: Worker animation doesn't match the resource
Post by: silnarm on 16 March 2011, 22:38:20
I'm (almost) certain I fixed this.

This was done in GAE when an exploit that -Archmage- hinted at was fixed. The exploit fix made it into MG and I think I added comments stating where the animation selection is wrong, but didn't add the code as it was/is a bit clumsy.

relevant clumsy code (from cmd_types_worker.cpp, belong in unit_updater.cpp for MG):
Code: [Select]
// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const MoveSkillType* getMoveLoadedSkill(Unit *u) {
const MoveSkillType *mst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
mst = t->getMoveLoadedSkillType();
break;
}
}
return mst;
}

// hacky helper for !HarvestCommandType::canHarvest(u->getLoadType()) animation issue
const StopSkillType* getStopLoadedSkill(Unit *u) {
const StopSkillType *sst = 0;
for (int i=0; i < u->getType()->getCommandTypeCount<HarvestCommandType>(); ++i) {
const HarvestCommandType *t = u->getType()->getCommandType<HarvestCommandType>(i);
if (t->canHarvest(u->getLoadType())) {
sst = t->getStopLoadedSkillType();
break;
}
}
return sst;
}
Title: Re: Worker animation doesn't match the resource
Post by: hailstone on 18 March 2011, 00:05:58
I'm (almost) certain I fixed this.
I thought you did too. I think several fixes have been lost somehow.
Title: Re: Worker animation doesn't match the resource
Post by: softcoder on 17 April 2011, 05:29:43
Fixed now in megaglest, thanks silnarm