Skip to content

Commit 551a8b1

Browse files
Fix: fixedness knowledge preventing merging of supermaterials
The fixedness of supermaterials now how no impact on gameplay, and they are always unfixed. However, the *knowledge* of whether a supermaterial item was fixed or not still mattered for merging purposes. To exacerbate things, whether or not this status was known did not matter for the purposes of considering it fully identified or not. bouquet noticed this with two stacks of apparently identical, fully-identified mithril daggers that would not merge. To repeat the bug: wish for two mithril daggers. Drop them on an altar. Read a blessed scroll of magic detection. Wield one of the daggers and kill grid bugs until the enchantment is known. Read a scroll of identify. The other dagger will be fully identified (the one you're wielding can't be IDed further), and they will not merge. This fixes that, and I also tweaked a few lines of code I came across in the process to make their meanings clearer.
1 parent 8c49e5c commit 551a8b1

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3337,3 +3337,4 @@ The following changes to date are:
33373337
- Fix: convicts don't feel guilty about stealing
33383338
- Fix: push boots off tortles when reverting from polyform
33393339
- Require manual suppression of attacks vs. dangerous enemies
3340+
- Fix: fixedness knowledge preventing merging of supermaterials

src/invent.c

+1
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,7 @@ register struct obj *otmp, *obj;
38223822
return FALSE;
38233823

38243824
if ((obj->oclass == WEAPON_CLASS || obj->oclass == ARMOR_CLASS)
3825+
&& !is_supermaterial(obj)
38253826
&& (obj->oerodeproof != otmp->oerodeproof
38263827
|| obj->rknown != otmp->rknown))
38273828
return FALSE;

src/mkobj.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -3790,8 +3790,7 @@ int material;
37903790
otmp->oeroded = 0;
37913791
if ((otmp->oeroded2) && !is_corrodeable(otmp) && !is_rottable(otmp))
37923792
otmp->oeroded2 = 0;
3793-
if (otmp->oerodeproof && !is_damageable(otmp))
3794-
otmp->oerodeproof = 0;
3793+
maybe_erodeproof(otmp, otmp->oerodeproof);
37953794
}
37963795

37973796
/*mkobj.c*/

src/objnam.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1754,8 +1754,7 @@ struct obj *otmp;
17541754
|| otmp->oclass == POTION_CLASS)
17551755
return FALSE;
17561756
else /* lack of `rknown' only matters for vulnerable objects */
1757-
return (boolean) (is_rustprone(otmp) || is_corrodeable(otmp)
1758-
|| is_flammable(otmp));
1757+
return (boolean) (is_damageable(otmp));
17591758
}
17601759

17611760
/* format a corpse name (xname() omits monster type; doname() calls us);

src/pray.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,7 @@ aligntyp g_align;
14031403
break;
14041404
}
14051405
otmp->otyp = rnd_class(bases[SPBOOK_CLASS], SPE_FREEZE_SPHERE);
1406-
otmp->material = objects[otmp->otyp].oc_material;
1407-
otmp->owt = weight(otmp);
1406+
set_material(otmp, objects[otmp->otyp].oc_material);
14081407
}
14091408
if (!u.uconduct.literate && (otmp->otyp != SPE_BLANK_PAPER)
14101409
&& !known_spell(otmp->otyp)) {
@@ -2303,7 +2302,7 @@ dosacrifice()
23032302
break;
23042303
}
23052304
otmp->otyp = rnd_class(bases[SPBOOK_CLASS], SPE_FREEZE_SPHERE);
2306-
otmp->material = objects[otmp->otyp].oc_material;
2305+
set_material(otmp, objects[otmp->otyp].oc_material);
23072306
otmp->owt = weight(otmp);
23082307
}
23092308

0 commit comments

Comments
 (0)