mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 04:26:42 +03:00
Make SetHP only throw an error if the item represents something intelligent - as it stands, with one of the constructors requiring a HP value, it makes the most sense to just allow HP to be set for a non-intelligent item, as it seems said value is ignored by the engine, anyway.
This commit is contained in:
parent
33dcd85a06
commit
2dd4f546fa
1 changed files with 2 additions and 1 deletions
|
@ -146,7 +146,8 @@ short GameScriptItemInfo::GetHP() const
|
|||
|
||||
void GameScriptItemInfo::SetHP(short hp)
|
||||
{
|
||||
if (hp < 0 || hp > Objects[m_item->objectNumber].hitPoints)
|
||||
if(Objects[m_item->objectNumber].intelligent &&
|
||||
(hp < 0 || hp > Objects[m_item->objectNumber].hitPoints))
|
||||
{
|
||||
if (WarningsAsErrors)
|
||||
throw std::runtime_error("invalid HP");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue