There's a bullet without my name on it.

This commit is contained in:
MarcEricMartel
2023-12-13 13:47:34 -05:00
parent d3c6353f17
commit 18d6d58203
5 changed files with 25 additions and 9 deletions

View File

@@ -3,7 +3,10 @@
Bullet::Bullet(Vector3f pos, Vector3f dir) : m_startpos(pos), m_currentpos(pos), m_velocity(dir) {}
Bullet::Bullet(Vector3f pos, Vector3f dir, uint64_t shooter_id): m_startpos(pos), m_currentpos(pos), m_velocity(dir), m_shooter_id(shooter_id) {}
Bullet::Bullet(Vector3f pos, Vector3f dir, uint64_t shooter_id) : m_startpos(pos), m_currentpos(pos), m_velocity(dir), m_shooter_id(shooter_id) {}
Bullet::Bullet(Vector3f pos, Vector3f dir, uint64_t shooter_id, bool canhurt): m_startpos(pos), m_currentpos(pos), m_velocity(dir), m_shooter_id(shooter_id), m_canhurt(canhurt) {}
Bullet::~Bullet() {}
@@ -23,7 +26,8 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordere
hit = true;
}
if (hit && !player->AmIDead()) {
player->InflictDamage(damage);
if (m_canhurt)
player->InflictDamage(damage);
player->m_hit = true;
if (player->AmIDead())