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<WorldPackets::Spells::ResyncRune>::construct<WorldPackets::Spells::ResyncRune, unsigned char &, unsigned int &>' 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<std::allocator<WorldPackets::Spells::ResyncRune> >::construct<WorldPackets::Spells::ResyncRune, unsigned char &, unsigned int &>' 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<WorldPackets::Spells::ResyncRune, std::allocator<WorldPackets::Spells::ResyncRune> >::emplace_back<unsigned char &, unsigned int &>' 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.
This commit is contained in:
ccrs
2019-07-14 14:20:39 +02:00
parent bbb9d94acc
commit 6826b8cb2c

View File

@@ -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());
}