SQC-15_online #1

Merged
memartel merged 349 commits from SQC-15_online into master 2023-12-10 17:41:26 -05:00
Showing only changes of commit 2a4a5e13cc - Show all commits

View File

@@ -13,23 +13,13 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe, std::map<uint
for (int x = 0; x < max; ++x) { for (int x = 0; x < max; ++x) {
m_currentpos += m_velocity * elapsedtime; m_currentpos += m_velocity * elapsedtime;
for (auto& [key, player] : mapPlayer) {
std::map<uint64_t, Player*>::iterator it = mapPlayer.begin(); if ((m_currentpos - player->GetPosition()).Length() < .4f) {
while (it != mapPlayer.end())
{
Player* player = it->second;
Vector3f playerPos = player->GetPosition();
if (playerPos == m_currentpos)
{
player->InflictDamage(damage); player->InflictDamage(damage);
return true; return true;
} }
it++;
} }
if (!world->ChunkAt(m_currentpos)) if (!world->ChunkAt(m_currentpos))
return true; return true;
else if (world->BlockAt(m_currentpos) != BTYPE_AIR) { else if (world->BlockAt(m_currentpos) != BTYPE_AIR) {