{"comment":{"created_at":"2011-10-11T09:11:35Z","body":"https://github.com/TrinityCore/TrinityCore/issues/3449","updated_at":"2011-10-11T09:11:35Z","url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/comments/2359204","id":2359204,"user":{"avatar_url":"https://secure.gravatar.com/avatar/2ada5d52d3067fbe260285dd2fab7454?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/cyberbrest","id":148529,"login":"cyberbrest"}},"action":"created","issue":{"number":3452,"created_at":"2011-10-11T09:08:12Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Created in - 76c9c30c2b3ad32f61a0a588c7d8625e0c5f2d09\r\nERRORs Like\r\n\r\n```\r\n/home/trinity/compile/src/server/game/Grids/ObjectGridLoader.cpp:85:104: error: cannot declare member function ‘static void ObjectGridLoader::SetObjectCell(T*, const CellPair&)’ to have static linkage [-fpermissive]\r\n/home/trinity/compile/src/server/game/Grids/ObjectGridLoader.cpp:89:96: error: cannot declare member function ‘static void ObjectGridLoader::SetObjectCell(T*, const CellPair&) [with T = Creature, CellPair = CoordPair<512u>]’ to have static linkage [-fpermissive]\r\n/home/trinity/compile/src/server/game/Grids/ObjectGridLoader.cpp:89:12: error: explicit template specialization cannot have a storage class\r\nmake[2]: *** [src/server/game/CMakeFiles/game.dir/Grids/ObjectGridLoader.cpp.o] Ошибка 1\r\n\r\n```\r\nFixe:\r\n\r\n```\r\ndiff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp\r\n--- a/src/server/game/Entities/Creature/Creature.cpp\r\n+++ b/src/server/game/Entities/Creature/Creature.cpp\r\n@@ -2430,3 +2430,9 @@\r\n     CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());\r\n     return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS);\r\n }\r\n+\r\n+void Creature::SetObjectCell(CellPair const& cellPair)\r\n+{\r\n+    Cell cell(cell_pair);\r\n+    SetCurrentCell(cell);\r\n+}\r\n\\ No newline at end of file\r\ndiff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h\r\n--- a/src/server/game/Entities/Creature/Creature.h\r\n+++ b/src/server/game/Entities/Creature/Creature.h\r\n@@ -422,6 +422,8 @@\r\n public:\r\n     MapCreature() : _moveState(CREATURE_CELL_MOVE_NONE) {}\r\n \r\n+protected:\r\n+    void SetCurrentCell(Cell const& cell) { _currentCell = cell; }\r\n private:\r\n     Cell _currentCell;\r\n     Cell const& GetCurrentCell() const { return _currentCell; }\r\n@@ -425,7 +427,6 @@\r\n private:\r\n     Cell _currentCell;\r\n     Cell const& GetCurrentCell() const { return _currentCell; }\r\n-    void SetCurrentCell(Cell const& cell) { _currentCell = cell; }\r\n \r\n     CreatureCellMoveState _moveState;\r\n     Position _newPosition;\r\n@@ -706,6 +707,7 @@\r\n         uint32 GetGUIDTransport() { return guid_transport; }\r\n \r\n         void FarTeleportTo(Map* map, float X, float Y, float Z, float O);\r\n+        void SetObjectCell(CellPair const& cellPair);\r\n     protected:\r\n         bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data = NULL);\r\n         bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);\r\ndiff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h\r\n--- a/src/server/game/Entities/Object/Object.h\r\n+++ b/src/server/game/Entities/Object/Object.h\r\n@@ -314,6 +314,8 @@\r\n \r\n         Corpse* ToCorpse(){ if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return NULL; }\r\n         const Corpse* ToCorpse() const {if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; }\r\n+\r\n+        virtual void SetObjectCell(CellPair const& cellPair) {}\r\n     protected:\r\n \r\n         Object ();\r\ndiff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp\r\n--- a/src/server/game/Grids/ObjectGridLoader.cpp\r\n+++ b/src/server/game/Grids/ObjectGridLoader.cpp\r\n@@ -82,18 +82,7 @@\r\n         uint32 i_corpses;\r\n };\r\n \r\n-template<class T> static void ObjectGridLoader::SetObjectCell(T* /*obj*/, CellPair const& /*cell_pair*/)\r\n-{\r\n-}\r\n-\r\n-template<> static void ObjectGridLoader::SetObjectCell(Creature* obj, CellPair const& cell_pair)\r\n-{\r\n-    Cell cell(cell_pair);\r\n-\r\n-    obj->SetCurrentCell(cell);\r\n-}\r\n-\r\n template <class T>\r\n void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)\r\n {\r\n     obj->GetGridRef().link(&m, obj);\r\n@@ -96,8 +85,8 @@\r\n template <class T>\r\n void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)\r\n {\r\n     obj->GetGridRef().link(&m, obj);\r\n-    ObjectGridLoader::SetObjectCell(obj, cell);\r\n+    obj->SetObjectCell(cell);\r\n     obj->AddToWorld();\r\n     if (obj->isActiveObject())\r\n         map->AddToActive(obj);\r\ndiff --git a/src/server/game/Grids/ObjectGridLoader.h b/src/server/game/Grids/ObjectGridLoader.h\r\n--- a/src/server/game/Grids/ObjectGridLoader.h\r\n+++ b/src/server/game/Grids/ObjectGridLoader.h\r\n@@ -43,9 +43,6 @@\r\n         void Visit(DynamicObjectMapType&) const {}\r\n \r\n         void LoadN(void);\r\n-\r\n-        template<class T> static void SetObjectCell(T* obj, CellPair const& cellPair);\r\n-\r\n     private:\r\n         Cell i_cell;\r\n         NGridType &i_grid;\r\n```","comments":1,"title":"[CompileFix] After relocation fixes (*nix)","updated_at":"2011-10-11T09:11:35Z","url":"https://api.github.com/repos/TrinityCore/TrinityCore/issues/3452","id":1872917,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/2ada5d52d3067fbe260285dd2fab7454?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/cyberbrest","id":148529,"login":"cyberbrest"},"html_url":"https://github.com/TrinityCore/TrinityCore/issues/3452","labels":[],"state":"open"},"legacy":{"issue_id":1872917,"comment_id":2359204}}