mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Fix segfault when redeeming more than four items at once
This commit is contained in:
parent
d5fe1cc513
commit
f2b1a84ef4
@ -762,10 +762,10 @@ void redeemCommand(std::string full, std::vector<std::string>& args, CNSocket* s
|
|||||||
}
|
}
|
||||||
|
|
||||||
int itemCount = ItemManager::CodeItems[code].size();
|
int itemCount = ItemManager::CodeItems[code].size();
|
||||||
int slots[4];
|
std::vector<int> slots;
|
||||||
|
|
||||||
for (int i = 0; i < itemCount; i++) {
|
for (int i = 0; i < itemCount; i++) {
|
||||||
slots[i] = ItemManager::findFreeSlot(plr);
|
slots.push_back(ItemManager::findFreeSlot(plr));
|
||||||
if (slots[i] == -1) {
|
if (slots[i] == -1) {
|
||||||
ChatManager::sendServerMessage(sock, "/redeem: Not enough space in inventory");
|
ChatManager::sendServerMessage(sock, "/redeem: Not enough space in inventory");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user