NovaSector / NovaSector

A Nova Sector downstream of /tg/station SS13.
GNU Affero General Public License v3.0
25 stars 233 forks source link

Removal or outright lack of the BODYSHAPE_SNOUTED tag. #2716

Open Follint opened 1 month ago

Follint commented 1 month ago

Issue Summary

Any form of rejuvenation deletes the BODYSHAPE_SNOUTED tag from the character. Xenobio is the worst offender but admin rejuvs bear the same issue. Changing race with mutagens, charged green extracts, clones from black regenerative, chilled or stable cerulean extracts and any regenerative extract either spawn a character without said tag, or remove an existing one. That being said, BODYSHAPE_DIGITIGRADE is totally fine and behaves as expected.

Round ID:

Testmerges:

Reproduction:

Well... Slap youself with a regenerative extract, retract and then deploy your MODsuit helmet or a compatible mask while having a snout. Or an admin could rejuvenate someone and check 57th line in VV to see the tag missing. The only way I know to bring the tag back is through a self actualizator, nothing else works afaik. Same goes for clones and body doubles from xenobio, they just spawn with no tag whatsoever.

Follint commented 1 month ago

As far as I've tested this issue i can only guess it stems from HEAL_ALL and ADMIN_HEAL_ALL procs, as the fate d20s heal also makes these tags disappear. But I can only read the code so far, I have no clue how these procs actually work and why do they make the character lose their snout tag while keeping leg ones. I assume it has something to do with the fact that legs are organs and thus get refreshed, and snouts are sprite accessories that get deleted with the head refresh (???), so they could behave differently, but i've got nothing on how to fix this and whether or not it is actually true.

Floofies commented 1 week ago

Snouts don't apply the snouted bodyshape by default, because not all snouts protrude enough. Because of this, it's bodyshapes variable starts as null and is later set by /obj/item/organ/external/snout/Insert().

Snouts are fully implemented as "external organs", and aren't just accessories, and the bodyshape is "synchronized" to the mob via two different procs which call synchronize_bodytypes().

The relevant procs that call synchronize_bodytypes() are:

Interestingly, the bodyshape won't be applied to the snout by Insert() unless it receives flags from its sprite accessory. Those flags are supposed to be passed by /datum/species/regenerate_organs, but only if the organ is being replaced with a new one, or if it was missing. If there was already a snout, I don't think regenerate_organs() will properly pass that flag, possibly being the root cause of this issue.