This commit is contained in:
MarcEricMartel 2023-12-16 15:52:39 -05:00
parent 7f9462881c
commit 90892ce7d3
2 changed files with 8 additions and 5 deletions

View File

@ -18,10 +18,10 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordere
for (auto& [key, player] : mapPlayer) {
bool hit = false;
if ((m_currentpos - player->GetPosition()).Length() < .5f) {
if ((m_currentpos - player->GetPosition()).Length() < 1.5f) {
hit = true;
}
else if ((m_currentpos - player->GetPOV()).Length() < .2f) {
else if ((m_currentpos - player->GetPOV()).Length() < .7f) {
damage *= 2; // HEADSHOT!
hit = true;
}

View File

@ -276,6 +276,7 @@ void Server::Run() {
default: break;
}
}
if (!lsPck.empty())
lsPck.clear();
/* Process */
@ -311,6 +312,7 @@ void Server::Run() {
else {
for (auto& chmo : conn->ChunkDiffs)
chunkdiffs.emplace_back(std::move(chmo));
if (!conn->ChunkDiffs.empty())
conn->ChunkDiffs.clear();
for (auto& bull : conn->Bullets) {
@ -323,6 +325,7 @@ void Server::Run() {
netbull.emplace_back(std::move(nbul));
}
if (!conn->Bullets.empty())
conn->Bullets.clear();
}
}