Skip to content
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

building human bot buys armour #2915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sweet235
Copy link
Contributor

Because why not

@DolceTriade
Copy link
Member

didn't test but it seems reasonable

@sweet235
Copy link
Contributor Author

The action equip tries to do that, but it seems this stopped to work at some time. But we can specify which armour to buy explicitely, as I found out. So this PR does that.

@slipher
Copy link
Contributor

slipher commented Jan 29, 2024

LGTM but there are 3 other cases of buy( WP_BUILD ) that should probably get the same treatment. In defend.bt, build.bt, and (a second one in) default_humans.bt.

@sweet235
Copy link
Contributor Author

sweet235 commented Feb 7, 2024

there are 3 other cases of buy( WP_BUILD )

And a 4th case: a bot spawns with the ckit.

built.bt is just a minimal example file right now, we can ignore it. (The bot does nothing if it cannot build anymore)

@sweet235
Copy link
Contributor Author

Here is your essay:

These BT instructions used to make a bot buy armour and ckit:

decorator return( STATUS_SUCCESS )
{
    action equip
}
action buy( WP_HBUILD )

Bisecting suggests that this does not work anymore since 100f802

The sequence decorator ... { action equip }; action buy( WP_HBUILD ) occurs two times in our code. Had its behavior not been changed, we would be fine. I created the second occurance after observing that the first occurance worked at that time.

It is true that this PR does not yet fix both occurances. But the reason is, as I am led to believe, that 100f802 changed this without testing it. Now the best we can do is to fix this step by step.

I shall not attempt to merge this. Someone seems to own all my PRs, and be trusted to change or close them as they please. I will leave the further decisions to the powers that be.

@slipher
Copy link
Contributor

slipher commented Feb 11, 2024

Probably we should have two different code paths for "just buy this equipment and don't change anything else" and "outfit oneself with exactly this set of equipment" instead of trying to do all of them with the same action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants