You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain items in Tf2, such as "The Blutsauger", "The Anger", etc. have a "The" prefixed when in Unique form.
When stringifying the SKUs of such items, the "The" is omitted.
Example:
const{ stringify, parseSKU }=require("tf2-item-format/static");console.log(stringify(parseSKU("36;6")));//returns "Blutsauger", should be "The Blutsauger"
Sites such as Backpack.tf respect the "The" prefix, and this module is currently incompatible with their more correct schema system.
Origin of the Bug
This bug originates within a dependency, node-tf2-static-schema. Specifically, the item-names.json file. tf2-item-format blindly trusts this file to resolve SKUs to item names. However, this bug cannot be blamed on tf2-static-schema, as they are providing the correct base name of the item, which is correct in most contexts
Proposed solution
Luckily, the method to find which item names have this prefix is quite simple. Items with the proper_name property set to true within the raw tf2 schema should have the "The" prefix when unique.
However, the name property does not always include the "The" prefix when the prefix is still required. For example, the "The Sun-on-a-Stick" has the name property set to "Sun-on-a-Stick".
In order to keep backwards compatibilty with existing systems, I propose that this fix should be implemented as a separate function, or as an option to the stringify function.
The text was updated successfully, but these errors were encountered:
This issue has already been solved by enabling flag in stringify. Example stringify(parseSKU("36;6", { determineUniqueHat: true })). It's not a default option because it would break existing apps.
Bug description
Certain items in Tf2, such as "The Blutsauger", "The Anger", etc. have a "The" prefixed when in Unique form.
When stringifying the SKUs of such items, the "The" is omitted.
Example:
Examples of affected items
This bug currently affects over 1,200 items
Why this matters
Sites such as Backpack.tf respect the "The" prefix, and this module is currently incompatible with their more correct schema system.
Origin of the Bug
This bug originates within a dependency, node-tf2-static-schema. Specifically, the item-names.json file.
tf2-item-format
blindly trusts this file to resolve SKUs to item names. However, this bug cannot be blamed on tf2-static-schema, as they are providing the correct base name of the item, which is correct in most contextsProposed solution
Luckily, the method to find which item names have this prefix is quite simple. Items with the
proper_name
property set totrue
within the raw tf2 schema should have the "The" prefix when unique.In order to keep backwards compatibilty with existing systems, I propose that this fix should be implemented as a separate function, or as an option to the
stringify
function.The text was updated successfully, but these errors were encountered: