1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-31 01:42:24 +01:00

Add valid_focus_gem()

Use to re-check that what you're putting in to a saber is a valid gem.
This commit is contained in:
ChrisANG 2021-01-12 15:21:06 -05:00
parent 4a6dd7d665
commit 2e81048b9f
2 changed files with 3 additions and 2 deletions
include
src

View file

@ -507,6 +507,7 @@ struct obj {
(otmp)->otyp == KAMEREL_VAJRA || \
(otmp)->otyp == BEAMSWORD || \
(otmp)->otyp == DOUBLE_LIGHTSABER)
#define valid_focus_gem(otmp) ((otmp)->oclass == GEM_CLASS && ((otmp)->otyp < LUCKSTONE || (otmp)->otyp == CHUNK_OF_FOSSIL_DARK))
#define is_vibroweapon(otmp) (force_weapon(otmp) || \
is_vibrosword(otmp) || \
otmp->otyp == VIBROBLADE || \

View file

@ -2597,7 +2597,7 @@ pick_gemstone()
Sprintf(buf, "Gems");
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, buf, MENU_UNSELECTED);
for(otmp = invent; otmp; otmp = otmp->nobj){
if(otmp->oclass == GEM_CLASS && (otmp->otyp < LUCKSTONE || otmp->otyp == CHUNK_OF_FOSSIL_DARK)){
if(valid_focus_gem(otmp)){
Sprintf1(buf, doname(otmp));
any.a_char = otmp->invlet; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
@ -2777,7 +2777,7 @@ register struct obj *obj;
gemlet = pick_gemstone();
for (otmp = invent; otmp; otmp = otmp->nobj) {
if(otmp->invlet == gemlet) break;
if(otmp->invlet == gemlet && valid_focus_gem(otmp)) break;
}
if(otmp){
current_container = obj;