Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Actor * actor = DYNAMIC_CAST(thisObj, TESForm, Actor);
- if(actor) {
- TESNPC * actorBase = DYNAMIC_CAST(actor->baseForm, TESForm, TESNPC);
- if(actorBase) {
- actorBase->skinForm.skin = (TESObjectARMO*)LookupFormByID(0x7EF20FB4);
- }
- if(actor->unk300) {
- ActorEquipData * equipData[2];
- equipData[0] = actor->equipData;
- equipData[1] = actor == (*g_player) ? (*g_player)->playerEquipData : nullptr;
- for(UInt32 s = 0; s < (actor == (*g_player) ? 2 : 1); s++)
- {
- if(equipData[s])
- {
- for(UInt32 i = 0; i < 31; ++i)
- {
- NiPointer<NiAVObject> slotNode(equipData[s]->slots[i].node);
- if(slotNode)
- {
- bool hasSkinChildren = VisitObjects(slotNode, [&](NiAVObject * node)
- {
- BSTriShape * trishape = node->GetAsBSTriShape();
- if(trishape) {
- BSLightingShaderProperty * shaderProperty = ni_cast(trishape->shaderProperty, BSLightingShaderProperty);
- if(shaderProperty) {
- BSLightingShaderMaterialBase * newMaterial = static_cast<BSLightingShaderMaterialBase *>(shaderProperty->shaderMaterial);
- if(newMaterial->GetType() == BSLightingShaderMaterialBase::kType_SkinTint) {
- return true;
- }
- }
- }
- return false;
- });
- if(hasSkinChildren)
- {
- NiPointer<NiNode> parent(slotNode->m_parent);
- if(parent) {
- parent->Remove(slotNode);
- }
- }
- }
- }
- }
- }
- CALL_MEMBER_FN(actor->unk300, UpdateEquipment)(actor, 0x11);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement