Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
* Fix refusi e sviste
Browse files Browse the repository at this point in the history
  • Loading branch information
jjak0b committed Feb 2, 2020
1 parent 1b18888 commit c975ceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/entities/Fuel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Fuel::Callback_OnCollide( GameEngine *game, Entity *collide_ent ) {
Player *player = this->world->GetPlayer();
if( IsDefined( player ) ) {
player->DoHeal(healthSize);
player->AddFuel(healthSize);
player->AddFuel(fuelSize);
}
this->shouldDeleteOnUpdate = true;
}
Expand Down
8 changes: 2 additions & 6 deletions src/entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,10 @@ double Player::GetMaxFuel() {


void Player::AddFuel( double amount ) {
if (this->fuel + amount > this->MaxHealth) {
this->fuel += amount;
if (this->fuel > this->MaxFuel) {
this->fuel = this->MaxFuel;
}
else
{
this->fuel += amount;
}

}

void Player::RemoveFuel( double amount ) {
Expand Down

0 comments on commit c975ceb

Please sign in to comment.