| 349 | } |
| 350 | |
| 351 | bool ToolUser::queryShieldHit(DamageSource const& source) const { |
| 352 | if (m_suppress.get() || !m_user) |
| 353 | return false; |
| 354 | |
| 355 | for (auto item : {m_primaryHandItem.get(), m_altHandItem.get()}) { |
| 356 | if (auto tool = as<ToolUserItem>(item)) |
| 357 | for (auto poly : tool->shieldPolys()) { |
| 358 | poly.translate(m_user->position()); |
| 359 | if (source.intersectsWithPoly(m_user->world()->geometry(), poly)) |
| 360 | return true; |
| 361 | } |
| 362 | } |
| 363 | return false; |
| 364 | } |
| 365 | |
| 366 | void ToolUser::tick(float dt, bool shifting, HashSet<MoveControlType> const& moves) { |
| 367 | if (auto toolUserItem = as<ToolUserItem>(m_primaryHandItem.get())) { |
no test coverage detected