diff --git a/.gitignore b/.gitignore
index f15149d..8ffde58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -378,3 +378,5 @@ FodyWeavers.xsd
/SQCSim2021/cmake/*
!/SQCSim2021/cmake/CMakeLists.txt
/SQCSim2021/SQCSim-client
+SQCSim2021/SQCSim2021.vcxproj.filters
+SQCSim2021/SQCSim2021.vcxproj
diff --git a/SQCSim-common/SQCSim-common.vcxproj b/SQCSim-common/SQCSim-common.vcxproj
index 991cd1d..4cebfaf 100644
--- a/SQCSim-common/SQCSim-common.vcxproj
+++ b/SQCSim-common/SQCSim-common.vcxproj
@@ -76,6 +76,7 @@
true
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ stdcpp20
Console
@@ -90,6 +91,7 @@
true
WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ stdcpp20
Console
@@ -104,6 +106,7 @@
true
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ stdcpp20
Console
@@ -118,7 +121,7 @@
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- stdcpp17
+ stdcpp20
Console
diff --git a/SQCSim-common/bullet.cpp b/SQCSim-common/bullet.cpp
index 873879d..09dde11 100644
--- a/SQCSim-common/bullet.cpp
+++ b/SQCSim-common/bullet.cpp
@@ -7,11 +7,19 @@ Bullet::Bullet(Vector3f pos, Vector3f dir, uint64_t tid): m_startpos(pos), m_cur
Bullet::~Bullet() {}
-bool Bullet::Update(World* world, float elapsedtime, int perframe) {
+bool Bullet::Update(World* world, float elapsedtime, int perframe, std::map mapPlayer) {
int max = 100 / perframe;
+ float damage = 0.057f;
for (int x = 0; x < max; ++x) {
m_currentpos += m_velocity * elapsedtime;
+ for (auto& [key, player] : mapPlayer) {
+ if ((m_currentpos - player->GetPosition()).Length() < .4f) {
+ player->InflictDamage(damage);
+ return true;
+ }
+ }
+
if (!world->ChunkAt(m_currentpos))
return true;
else if (world->BlockAt(m_currentpos) != BTYPE_AIR) {
@@ -20,7 +28,7 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe) {
}
else if ((m_currentpos - m_startpos).Length() > VIEW_DISTANCE) return true;
}
-
+
return false;
}
diff --git a/SQCSim-common/bullet.h b/SQCSim-common/bullet.h
index 1b5e227..cc04737 100644
--- a/SQCSim-common/bullet.h
+++ b/SQCSim-common/bullet.h
@@ -3,8 +3,12 @@
#include "define.h"
#include "vector3.h"
+#include