Skip to content

Commit

Permalink
Update MpActor.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Nov 9, 2023
1 parent 9ab5212 commit cb9242b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion skymp5-server/cpp/server_guest_lib/MpActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,20 @@ bool MpActor::OnEquip(uint32_t baseId)
const bool isIngredient = recordType == "INGR";
const bool isPotion = recordType == "ALCH";

if (!(isSpell || isIngredient || isPotion || isBook)) {
bool isTorch = false;
if (espm::utils::Is<espm::LIGH>(recordType)) {
auto& compressedFieldsCache = GetParent()->GetEspmCache();
auto light = espm::Convert<espm::LIGH>(lookupRes.rec);
auto res = light->GetData(compressedFieldsCache);
isTorch = res.data.flags & espm::LIGH::Flags::CanBeCarried;
}

const bool isScroll = recordType == "SCRL";
const bool isWeapon = recordType == "WEAP";
const bool isArmor = recordType == "ARMO";
const bool isAmmo = recordType == "AMMO";

if (!(isSpell || isIngredient || isPotion || isBook || isTorch || isScroll || isWeapon || isArmor || isAmmo)) {
return false;
}

Expand Down

0 comments on commit cb9242b

Please sign in to comment.