Skip to content

Commit

Permalink
Eliminate the chance of forging objects with random properties. The p…
Browse files Browse the repository at this point in the history
…roperty has to come from the first or second ingredient.
  • Loading branch information
elunna committed Oct 3, 2023
1 parent f734cc2 commit 22b9ed5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/fountain.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,11 @@ doforging(void)
output->material = obj1->material;
}

/* ensure that the newly forged object doesn't
randomly have a property added at creation */
output->oprops |= 0L;
output->oprops_known |= 0L;

/* any object properties, take secondary object property
over primary. if you know the object property of one
of the recipe objects, you'll know the object property
Expand All @@ -772,14 +777,7 @@ doforging(void)
if (obj1->oprops_known)
output->oprops_known |= output->oprops;
}

/* if neither recipe object have an object property,
ensure that the newly forged object doesn't
randomly have a property added at creation */
if ((obj1->oprops & 0L) && (obj2->oprops & 0L)) {
output->oprops |= 0L;
output->oprops_known |= 0L;
}

/* if objects are enchanted or have charges,
carry that over, and use the greater of the two */
if (output->oclass == obj2->oclass) {
Expand Down

0 comments on commit 22b9ed5

Please sign in to comment.