예제 #1
0
NiNode* MyClass::TEST_0046E720(NiNode* armor, NiNode* npc,UINT32 unk2,UINT32 unk3,UINT32 unk4,UINT32 unk5)
{
	char prefix[10];
	
	sprintf_s(prefix, "%08x ", armor);
	RenameNode(npc, armor, prefix);
	
	auto armornpc = CastNiNode(armor->GetObjectByName("NPC"));
	if(armornpc)
		for(int i=0; i<armornpc->m_children.m_arrayBufLen; ++i)
		{
			if(armornpc->m_children[i])
				CombineTree(m_root, armornpc);
		}
	else CombineTree(m_root, armor);

	auto armorInSkeleton = CALL_MEMBER_FN(this, UNKNOWN_0046E720)(armor, npc, unk2, unk3, unk4, unk5);
	
	if(armorInSkeleton)
	{
		ArmorAttachInfo info;
		info.skeleton = npc;
		info.id = (UINT32)armor;
		info.prefix = prefix;
	
		npc->IncRef();
		lockArmor.lock();
		armorInfos.insert(std::make_pair(armorInSkeleton, info));
		ResourceManager::get()->RegisterCallback(armorInSkeleton, OnArmorRelease);

		CWorld::getSingleton()->ScanAndAdd(info.id, prefix, npc, armor);
		lockArmor.unlock();
	}
	else ClearNode(npc, prefix);

	return armorInSkeleton;
}
예제 #2
0
 static void unlock(Lockable& l) {
   l.unlock();
 }