-
Notifications
You must be signed in to change notification settings - Fork 12
Description
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.