WeaponTags dont work for weapons without costlist/workToMake

Started by Syrchalis, October 02, 2018, 07:12:46 AM

Previous topic - Next topic

Syrchalis

If a weapon is created by a RecipeDef instead of using a CostList and WorkToMake in it's ThingDef it will not work with weapontags. Meaning Pawnkinds cannot get the weapon through the weapontag. Fixing this either requires setting a manual market value or adding WorkToMake and a CostList.

The confusing thing about this bug is that the weapons seem to have a proper MarketValue based on the RecipeDef if they are seen in-game as item - even if no CostList, WorkToMake or MarketValue is set. This market value is however not correctly calculated during PawnKind WeaponGeneration.

There is apparently also an issue in general with this system, as no matter the budget the pawns have, they rarely spawn without any weapon (no config error). Some of my custom pawnkinds with custom weapontags (and essentially infinite budget) spawn without weapons about 10-20% of the time. This does not seem to affect vanilla pawnkinds or weapontags.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Kenneth

Fixed the incorrect price calculation in pawnkind weapon generation, thanks for reporting! ;)

For the pawns spawning without weapon, if you think there's a bug in the vanilla code please open another thread about it and give us exact reproduction steps and test data we can use to repro this issue on our end.