Skip to content

Commit

Permalink
fix: added check for type 'two-handed' (#2410)
Browse files Browse the repository at this point in the history
Warnings when starting the server.
  • Loading branch information
Dvineone authored Mar 14, 2024
1 parent cba26d7 commit 93b3786
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/items/functions/item/item_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ void ItemParse::createAndRegisterScript(ItemType &itemType, pugi::xml_node attri
auto stringKey = asLowerCaseString(subKeyAttribute.as_string());
if (stringKey == "slot") {
auto slotName = asLowerCaseString(subValueAttribute.as_string());
if (moveevent && slotName != "two-handed" && (moveevent->getEventType() == MOVE_EVENT_EQUIP || moveevent->getEventType() == MOVE_EVENT_DEEQUIP)) {
if (moveevent && (moveevent->getEventType() == MOVE_EVENT_EQUIP || moveevent->getEventType() == MOVE_EVENT_DEEQUIP)) {
if (slotName == "head") {
moveevent->setSlot(SLOTP_HEAD);
} else if (slotName == "necklace") {
Expand All @@ -1049,6 +1049,8 @@ void ItemParse::createAndRegisterScript(ItemType &itemType, pugi::xml_node attri
moveevent->setSlot(SLOTP_RING);
} else if (slotName == "ammo") {
moveevent->setSlot(SLOTP_AMMO);
} else if (slotName == "two-handed") {
moveevent->setSlot(SLOTP_TWO_HAND);
} else {
g_logger().warn("[{}] unknown slot type '{}'", __FUNCTION__, slotName);
}
Expand Down

0 comments on commit 93b3786

Please sign in to comment.