Skip to content

Commit

Permalink
Fixed copying of shader controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
ousnius committed Jul 15, 2015
1 parent c47e1ad commit 8057e1f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions NifFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ void NifFile::CopyShader(const string& shapeDest, BSLightingShaderProperty* srcS
// Controller
NiUnknown* srcController = dynamic_cast<NiUnknown*>(srcNif.GetBlock(srcShader->controllerRef));
if (srcController) {
NiUnknown* destController = new NiUnknown((*srcController));
destController->header = &hdr;
NiUnknown* destController = new NiUnknown(srcController->CalcBlockSize());
destController->Clone(srcController);
int controllerId = blocks.size();
blocks.push_back(destController);
hdr.numBlocks++;
Expand Down Expand Up @@ -797,8 +797,8 @@ void NifFile::CopyShaderPP(const string& shapeDest, BSShaderPPLightingProperty*
// Controller
NiUnknown* srcController = dynamic_cast<NiUnknown*>(srcNif.GetBlock(srcShader->controllerRef));
if (srcController) {
NiUnknown* destController = new NiUnknown((*srcController));
destController->header = &hdr;
NiUnknown* destController = new NiUnknown(srcController->CalcBlockSize());
destController->Clone(srcController);
int controllerId = blocks.size();
blocks.push_back(destController);
hdr.numBlocks++;
Expand Down Expand Up @@ -1048,8 +1048,8 @@ void NifFile::CopyStrips(const string& shapeDest, NifFile& srcNif, const string&

NiUnknown* srcUnknown = dynamic_cast<NiUnknown*>(srcNif.GetBlock(src->propertiesRef[i]));
if (srcUnknown) {
NiUnknown* destUnknown = new NiUnknown((*srcUnknown));
destUnknown->header = &hdr;
NiUnknown* destUnknown = new NiUnknown(srcUnknown->CalcBlockSize());
destUnknown->Clone(srcUnknown);
int unknownId = blocks.size();
blocks.push_back(destUnknown);
hdr.numBlocks++;
Expand Down Expand Up @@ -1271,8 +1271,8 @@ void NifFile::CopyShape(const string& shapeDest, NifFile& srcNif, const string&

NiUnknown* srcUnknown = dynamic_cast<NiUnknown*>(srcNif.GetBlock(src->propertiesRef[i]));
if (srcUnknown) {
NiUnknown* destUnknown = new NiUnknown((*srcUnknown));
destUnknown->header = &hdr;
NiUnknown* destUnknown = new NiUnknown(srcUnknown->CalcBlockSize());
destUnknown->Clone(srcUnknown);
int unknownId = blocks.size();
blocks.push_back(destUnknown);
hdr.numBlocks++;
Expand Down

0 comments on commit 8057e1f

Please sign in to comment.