From 6826b8cb2cafd3f64c40357c53e10b8ceaea6b8a Mon Sep 17 00:00:00 2001 From: ccrs Date: Sun, 14 Jul 2019 14:20:39 +0200 Subject: Build: fix build error In file included from /home/circleci/project/src/server/game/Entities/Player/Player.cpp:19: In file included from /home/circleci/project/src/server/game/Entities/Player/Player.h:22: In file included from /home/circleci/project/src/server/game/Entities/Unit/Unit.h:22: In file included from /home/circleci/project/src/server/game/Entities/Object/Object.h:22: In file included from /home/circleci/project/src/common/Common.h:23: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/memory:63: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/allocator.h:46: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/c++allocator.h:33: /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ext/new_allocator.h:136:23: fatal error: no matching constructor for initialization of 'WorldPackets::Spells::ResyncRune' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/alloc_traits.h:475:8: note: in instantiation of function template specialization '__gnu_cxx::new_allocator::construct' requested here { __a.construct(__p, std::forward<_Args>(__args)...); } ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/vector.tcc:103:21: note: in instantiation of function template specialization 'std::allocator_traits >::construct' requested here _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish, ^ /home/circleci/project/src/server/game/Entities/Player/Player.cpp:24611:22: note: in instantiation of function template specialization 'std::vector >::emplace_back' requested here packet.Runes.emplace_back(type, cooldown); ^ /home/circleci/project/src/server/game/Server/Packets/SpellPackets.h:117:16: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided struct ResyncRune ^ /home/circleci/project/src/server/game/Server/Packets/SpellPackets.h:117:16: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided /home/circleci/project/src/server/game/Server/Packets/SpellPackets.h:117:16: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 2 were provided 1 error generated. --- src/server/game/Entities/Player/Player.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 147798a8c42..badbec9377b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24606,9 +24606,10 @@ void Player::ResyncRunes() const packet.Count = MAX_RUNES; for (uint32 itr = 0; itr < MAX_RUNES; ++itr) { - uint8 type = GetCurrentRune(itr); - uint32 cooldown = uint32(255) - ((GetRuneCooldown(itr) * uint32(255)) / uint32(RUNE_BASE_COOLDOWN)); // cooldown time (0-255) - packet.Runes.emplace_back(type, cooldown); + WorldPackets::Spells::ResyncRune resyncRune; + resyncRune.RuneType = GetCurrentRune(itr); + resyncRune.Cooldown = uint8(255) - uint8(GetRuneCooldown(itr) * uint32(255) / uint32(RUNE_BASE_COOLDOWN)); // cooldown time (0-255) + packet.Runes.emplace_back(resyncRune); } SendDirectMessage(packet.Write()); } -- cgit v1.2.3