Fix custom ped textures persisting after resource stop/disconnect#5014
Fix custom ped textures persisting after resource stop/disconnect#5014TheCrazy17 wants to merge 1 commit into
Conversation
|
thx claude |
…nnect engineImportTXD replacements applied to a ped model never got visually reverted for the local player: the ped-restream gate checked IsStreamedIn(), which never becomes true for the local player since it's created via _CreateLocalModel() instead of the normal streaming path. Additionally, removing a replacement never forced the model to drop its loaded clump the way applying one does, so even when the restream did run it wasn't guaranteed to pick up the restored textures. Fixes multitheftauto#1877.
fc2825e to
a32aa2e
Compare
What exactly are you trying to achieve with these comments? Instead of mocking people who are actually working, contributing, and trying to improve the project, maybe you should focus on doing something useful yourself. Trying to belittle people’s work with these passive-aggressive comments just looks petty and, honestly, pathetic. If you have a real technical criticism, say it properly. Otherwise, stop making these unnecessary remarks. Don’t worry though, I won’t let these comments bother me. Congratulations, @TheCrazy17. |
I didn't see any policy that prohibits using AI tools as assistance. What matters is that the fix is correct and tested, do you have any actual feedback on the code itself? I'm just trying to help out while testing new tools. Otherwise, you're free to open your own pull request, and no one is obligated to accept mine. lol |
|
There's a difference between using AI and knowing what you're doing when using AI, keep at it though maybe one of these days gpt or claude will get something right and it'll get merged |
Summary
Fixes custom ped textures/skins applied via
engineImportTXDnot reverting to the original texture when the replacement is removed (resource stop, scriptstopResource, or disconnecting from the server).Two issues in the ped texture-restream path, both specific to the local player:
CClientPedManager::RestreamPeds/RestreamAllPedsgated the model-refresh hack behindIsStreamedIn(), which never becomestruefor the local player (its ped is created via_CreateLocalModel(), which doesn't go through the normalInternalStreamIn()path that sets that flag). This meant the refresh never even attempted to run when you were wearing the modified skin yourself.CRenderWareSA::ModelInfoTXDRemoveTexturesrestored the original textures in the TXD dictionary, but never forced the ped model to drop its currently-loaded clump, unlikeGetModelTexturesInfowhich does this when the replacement is first applied. Without it, an already-rendered ped had no guarantee it would pick the restored textures back up.Motivation
Fixes #1877.
Test plan
zm-skin.zip
engineLoadTXD+engineImportTXDfrom a test resource.Checklist