Sigoles
Discord: @sigoles
- Joined
- Nov 20, 2015
- Messages
- 1,209
- Solutions
- 2
- Reaction score
- 154
for what is this, to limit something? in items.cpp
tfs 1.2
C++:
switch (attrib) {
case ITEM_ATTR_SERVERID: {
if (datalen != sizeof(uint16_t)) {
return ERROR_INVALID_FORMAT;
}
if (!stream.read<uint16_t>(serverId)) {
return ERROR_INVALID_FORMAT;
}
if (serverId > 30000 && serverId < 30100) {
serverId -= 30000;
}
break;
}
C++:
void Items::buildInventoryList()
{
inventory.reserve(30000);
for(const auto &type: items) {
if(type.weaponType != WEAPON_NONE || type.ammoType != AMMO_NONE ||
type.attack != 0 || type.defense != 0 ||
type.extraDefense != 0 || type.armor != 0 ||
(type.slotPosition & SLOTP_NECKLACE) == SLOTP_NECKLACE ||
(type.slotPosition & SLOTP_RING) == SLOTP_RING ||
(type.slotPosition & SLOTP_AMMO) == SLOTP_AMMO ||
(type.slotPosition & SLOTP_FEET) == SLOTP_FEET ||
(type.slotPosition & SLOTP_HEAD) == SLOTP_HEAD ||
(type.slotPosition & SLOTP_ARMOR) == SLOTP_ARMOR ||
(type.slotPosition & SLOTP_LEGS) == SLOTP_LEGS)
{
inventory.push_back(type.clientId);
}
}
inventory.shrink_to_fit();
std::sort(inventory.begin(), inventory.end());
}
C++:
void Items::parseItemNode(const pugi::xml_node& itemNode, uint16_t id)
{
if (id > 30000 && id < 30100) {
id -= 30000;
tfs 1.2