oooooooooo

This commit is contained in:
MarcEricMartel
2023-12-18 14:24:43 -05:00
parent f1bb7447f9
commit 25b5c1e492
5 changed files with 23 additions and 18 deletions

View File

@@ -199,11 +199,11 @@ void Player::ApplyTransformation(Transformation& transformation, bool rel, bool
void Player::TakeBooster(std::unordered_map<uint64_t, Booster*> booster_table, float elapsedtime)
{
Vector3f playerpos = GetPosition();
for (auto& [key, booster]: booster_table)
{
for (auto& [key, booster]: booster_table) {
Vector3f pos = booster->GetPosition();
if (booster->GetAvailability() && abs(playerpos.x - pos.x) <= 0.5f && abs(playerpos.y - pos.y) <= 1.0f && abs(playerpos.z - pos.z) <= 0.5f)
{
std::cout << "booster got" << std::endl;
GetBooster(booster->GetType(), elapsedtime);
booster->SetAvailability(false);
break;