Using: clean TFS 1.3 and OTC source
I have been trying increase the max limit of stackable items from 100 to any value.
In game.cpp:
otland/forgottenserver (https://github.com/otland/forgottenserver/blob/4931bfffa40d82da1092591c26de6009460d1c4c/src/game.cpp#L1158)
Changing from 100 to 999, i can stack until 255 items:
The problem occur when you add more than 255 items in a single stack.
The item get reseted to 1 and is added by the amount moved on it.
I already tried search in all files related to "itemcount" changing "100" to "999" and also uint8 to uint16, but i still dont got it working.
I also did a search in OTC source, for itemcount, 100, and anything related, and i have find only it:
I tried change it to getU16, but after compile with U16, i cant open any container in game, i also receive an error in OTC console when i drop or try open any bag:
I appreciate any help!
I have been trying increase the max limit of stackable items from 100 to any value.
In game.cpp:
otland/forgottenserver (https://github.com/otland/forgottenserver/blob/4931bfffa40d82da1092591c26de6009460d1c4c/src/game.cpp#L1158)
C++:
//update item(s)
if (item->isStackable()) {
uint32_t n;
if (item->equals(toItem)) {
n = std::min<uint32_t>(999 - toItem->getItemCount(), m);
toCylinder->updateThing(toItem, toItem->getID(), toItem->getItemCount() + n);
updateItem = toItem;
}
Changing from 100 to 999, i can stack until 255 items:
The problem occur when you add more than 255 items in a single stack.
The item get reseted to 1 and is added by the amount moved on it.
I already tried search in all files related to "itemcount" changing "100" to "999" and also uint8 to uint16, but i still dont got it working.
I also did a search in OTC source, for itemcount, 100, and anything related, and i have find only it:
otclient/src/client/protocolgameparse.cpp at 066df4dd52bb352b654e683efcb2f4eab31a0c78 · edubart/otclient
An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to custom...
github.com
C++:
int itemCount = msg->getU8();
std::vector<ItemPtr> items(itemCount);
for(int i = 0; i < itemCount; i++)
items[i] = getItem(msg);
I tried change it to getU16, but after compile with U16, i cant open any container in game, i also receive an error in OTC console when i drop or try open any bag:
When i open a container:
ProtocolGame parse message exception (1 bytes unread, last opcode is 110, prev opcode is -1): unable to create item with invalid id 65291
When i drop a container:
ERROR: ProtocolGame parse message exception (24 bytes unread, last opcode is 110, prev opcode is 160): unable to create item with invalid id 65291
ProtocolGame parse message exception (1 bytes unread, last opcode is 110, prev opcode is -1): unable to create item with invalid id 65291
When i drop a container:
ERROR: ProtocolGame parse message exception (24 bytes unread, last opcode is 110, prev opcode is 160): unable to create item with invalid id 65291
I appreciate any help!
Last edited: