Skip to content

match more ai::Query#162

Open
hgh32 wants to merge 1 commit intozeldaret:masterfrom
hgh32:master
Open

match more ai::Query#162
hgh32 wants to merge 1 commit intozeldaret:masterfrom
hgh32:master

Conversation

@hgh32
Copy link
Copy Markdown
Contributor

@hgh32 hgh32 commented Apr 12, 2026

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@Pistonight Pistonight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to send decompme if you have questions about the suggestions

@Pistonight made 6 comments.
Reviewable status: 0 of 13 files reviewed, 5 unresolved discussions (waiting on hgh32).


src/Game/AI/Query/queryCheckItemShopPorchVacancy.cpp line 16 at r1 (raw file):

    if (gdm != nullptr) {
        int isp = -1;
        if (gdm->getParam().get().getS32(&isp, "Shop_CurrentItemState") && (isp == 7)) {

I think it's possible these are inlined helpers in GDT Mgr , like gdm->getS32ByName(...)


src/Game/AI/Query/queryCheckAppShopSelect.cpp line 14 at r1 (raw file):

    auto* gdm = ksys::gdt::Manager::instance();
    if (gdm != nullptr) {
        int as = -1;

as -> screen_type, same for other files


src/Game/AI/Query/queryHasItemDyeSpecifiedColor.cpp line 14 at r1 (raw file):

int HasItemDyeSpecifiedColor::doQuery() {
    s32 sis = ksys::gdt::getFlag_Shop_ItemState();
    switch (sis) {

are you sure this is a switch statement and not return state == 0 || state == 9;?


src/Game/AI/Query/queryBranchByDyeColor.cpp line 12 at r1 (raw file):

int BranchByDyeColor::doQuery() {
    auto ccm = ksys::gdt::getFlag_ColorChange_MaterialIndex();

could we have more readable variable names? i.e. color_change_material_index or index


src/Game/AI/Query/queryCheckPlacedItemSaled.cpp line 21 at r1 (raw file):

            ics = 1;
        }
    }

Try collapsing the 2 variables

Suggestion:

    int state = 2;
    if (gdm != nullptr) {
        gdm->getParamBypassPerm().get().getS32(&state, "PlacedItemCountState");
        if (state == 3) {
            state = 1;
        }
    }

@hgh32
Copy link
Copy Markdown
Contributor Author

hgh32 commented Apr 16, 2026

except inline should be done

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.

2 participants