Functions to set Creature Held Item, and helper function to check whether Creature is holding a specific held item.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -178,3 +178,10 @@ const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() const {
|
||||
variant = _variant;
|
||||
return variant;
|
||||
}
|
||||
void Battling::Creature::SetHeldItem(const std::string& itemName) {
|
||||
const Library::Item* item;
|
||||
if (!_library->GetItemLibrary()->TryGet(itemName, item)) {
|
||||
throw CreatureException("Item not found.");
|
||||
}
|
||||
_heldItem = item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user