-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the attack enemy sheep bug #516
Conversation
…added, and therefore the "AttackAbility::can_invoke" method was returning false. Signed-off-by: akveton <antonin.kveton@cern.ch>
|
Signed-off-by: kvetoant <kvetoant@fel.cvut.cz>
The Gathering must be a higher priority, otherwise the target is killed and the villager returns to an idle state. When gather is used, it automatically stacks the attack on top, so when the target is killed, the villager begins gathering. |
I have fixed 1.-3. (hopefully 2. is correct), sorry for the mess. As for 4., I had the same feeling as you do. When I was skimming through the code, I found that the only other place in the code this flag is being set is in Edit: |
Looking at Simply removing |
Removing |
You're right, you should check the attacker has attribute |
Then, aren't other resources like turkeys an exception as well? (btw, please use tab indentation, otherwise it looks good now code-style wise :) |
I'm still a bit confused about the whole unit type thing, is it possible that turkeys also have unit type |
My IDE was messing the indentation up, should be ok from the next commit on. Upon further examination, Therefore, further classification of units might be needed instead (is a military attackable resource), a rundown:
A proposal of the new part of the logic would then look something like this in pseudocode: if (is enemy and is not resource) or (is resource and selected unit is gatherer) or (is enemy and is resource and is military_attackable_resource):
can_attack = True This is under assumption gaia stays hostile. Unsure how to handle the trebuchet/onager - tree thing. Perhaps yet another classifier will be needed. |
I'm pretty sure the onager-tree-interaction was by setting an area to attack. The trees get killed by splash damage. There might be another special case to consider, the most basic one of the onager-style siege weapons was not able to kill trees. |
Can't remember the original game, but the trees are directly targetable by onagers and trebuchets in the HD version, at least (without setting an area to attack) - a green rectangle, similar to buildings, appears, suggesting trees are treated as buildings in the HD version. |
The extracted game data contains an
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
Timeout detected, but ready for a revive. |
The
command_flag::attack_res
flag was not being added, and therefore theAttackAbility::can_invoke
method was returning false. Please review my changes.Fixes #369.