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

in UnBrogue, rune presses burn staffs up #22

Open
MattWeiner opened this issue Nov 29, 2020 · 0 comments
Open

in UnBrogue, rune presses burn staffs up #22

MattWeiner opened this issue Nov 29, 2020 · 0 comments

Comments

@MattWeiner
Copy link

I've noticed in a few games that rune presses burn staffs up instead of applying the rune to them.

Looking at the UnBrogue code I suspect that the issue is here, web-brogue/unBrogue/UnBrogueCode/Items.c lines 9431-9441

if ((theFirstItem->category & KEY) && (theFirstItem->kind == KEY_RUNE_WAND) && (theSecondItem->category & (WAND))) {
applyRunetoWandorStaff(theFirstItem, theSecondItem);
}
else if ((theFirstItem->category & KEY) && (theFirstItem->kind == KEY_RUNE_WAND) && (theSecondItem->category & (WAND))) {
applyRunetoWandorStaff(theFirstItem, theSecondItem);
}
else if ((theSecondItem->category & KEY) && (theSecondItem->kind == KEY_RUNE_STAFF) && (theFirstItem->category & (STAFF))) {
applyRunetoWandorStaff(theSecondItem, theFirstItem);
}
else if ((theSecondItem->category & KEY) && (theSecondItem->kind == KEY_RUNE_STAFF) && (theFirstItem->category & (STAFF))) {
applyRunetoWandorStaff(theSecondItem, theFirstItem);

I don't know C, but it looks like the first two conditions are identical, and the last two conditions are identical. I think in the second condition (theSecondItem->category & (WAND) should be (theSecondItem->category & (STAFF) and in the third condition (theSecondItem->category & (STAFF) should be (theSecondItem->category & (WAND) [or something similar], so it will call properly with a staff and a rune in either order, or a wand and a rune in either order.

As things are, I bet that something calls this code with theFirstItem as the rune and theSecondItem as the staff, the code passes through here, and then bad things are happening somehow.

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

No branches or pull requests

1 participant