From: Loic Blot Date: Fri, 21 Apr 2017 22:36:59 +0000 (+0200) Subject: Revert a const ref on update texture X-Git-Tag: 0.4.16~214 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4f4e2e3e838fc640e45714d4666bc5d6b0aa8a25;p=oweals%2Fminetest.git 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 --- diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 3aa3bad97..2a4acd373 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -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(); diff --git a/src/content_cao.h b/src/content_cao.h index a0601d692..3be753529 100644 --- a/src/content_cao.h +++ b/src/content_cao.h @@ -200,7 +200,9 @@ public: 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();