Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert a const ref on update texture
if mod is a reference to a class member a variable swap breaks.
We should find a way to keep this const ref if possible.
Added a comment about this in header
  • Loading branch information
nerzhul committed Apr 21, 2017
1 parent 113c85a commit 4f4e2e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/content_cao.cpp
Expand Up @@ -1313,7 +1313,7 @@ void GenericCAO::updateTexturePos()
}
}

void GenericCAO::updateTextures(const std::string &mod)
void GenericCAO::updateTextures(std::string mod)
{
ITextureSource *tsrc = m_client->tsrc();

Expand Down
4 changes: 3 additions & 1 deletion src/content_cao.h
Expand Up @@ -200,7 +200,9 @@ class GenericCAO : public ClientActiveObject

void updateTexturePos();

void updateTextures(const std::string &mod);
// std::string copy is mandatory as mod can be a class member and there is a swap
// on those class members
void updateTextures(std::string mod);

void updateAnimation();

Expand Down

0 comments on commit 4f4e2e3

Please sign in to comment.