coredump fix & rpg actions

This commit is contained in:
Yunfan Li
2023-08-03 15:15:31 +08:00
parent 1d423e4820
commit 1c47108c23
14 changed files with 133 additions and 128 deletions

View File

@@ -15,7 +15,7 @@ class SpellInfo;
class ItemForSpellValue : public CalculatedValue<Item*>, public Qualified
{
public:
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name, 20 * 1000) { }
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name, 1) { }
Item* Calculate() override;

View File

@@ -40,7 +40,7 @@ bool SpellCastUsefulValue::Calculate()
qualifier == "rockbiter weapon" || qualifier == "earthliving weapon" || qualifier == "spellstone")
{
if (Item* item = AI_VALUE2(Item*, "item for spell", spellid))
if (item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
if (item->IsInWorld() && item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
return false;
}