JayMeazy
Member
- Joined
- Sep 7, 2020
- Messages
- 92
- Solutions
- 2
- Reaction score
- 24
Hello, I'm trying to call getCustomAttribute for a variable imbue slot system, and it seems to work until I equip the item, which crashes the server. I've tried a few different ways of calling it, here's what GDB says:
Here's how I'm calling it:
I tried a few different ways, this might not be where the problem is though, I just assumed because that's the only place I can find that does something with boost when you equip and an item with imbuing slots. The slots function properly, the imbue system functions properly, everything until you try to equip it. even if the item doesn't have any imbue's, the slots can be empty and it still crashes.
Code:
#0 0x00007ffff7ef15ce in epoll_wait (epfd=4, events=0x7fffffffdb00, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
resultvar = 18446744073709551612
sc_cancel_oldtype = 0
sc_ret = <optimized out>
#1 0x00005555557a4ff5 in boost::asio::detail::epoll_reactor::run(long, boost::asio::detail::op_queue<boost::asio::detail::scheduler_operation>&) ()
No symbol table info available.
#2 0x00005555557a6cf8 in boost::asio::detail::scheduler::run(boost::system::error_code&) ()
No symbol table info available.
#3 0x00005555555de19a in main ()
No symbol table info available.
Code:
uint32_t getImbuingSlots() const {
if (!attributes) {
return 0;
}
if (!attributes->hasAttribute(ITEM_ATTRIBUTE_CUSTOM)) {
return 0;
}
const ItemAttributes::CustomAttribute* attr = getCustomAttribute("IMBUE_SLOTS");
uint32_t tmp = static_cast<uint32_t>(boost::get<int64_t>(attr->value));
if (tmp > 0) {
return tmp;
}
return 0;
}