| 346 | } |
| 347 | |
| 348 | bool Npc::shouldDestroy() const { |
| 349 | if (auto res = m_scriptComponent.invoke<bool>("shouldDie")) |
| 350 | return *res; |
| 351 | else if (!m_statusController->resourcePositive("health") || m_scriptComponent.error()) |
| 352 | return true; |
| 353 | else |
| 354 | return false; |
| 355 | } |
| 356 | |
| 357 | void Npc::destroy(RenderCallback* renderCallback) { |
| 358 | m_scriptComponent.invoke("die"); |
no test coverage detected