summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'StarsEx/Player.cpp')
-rw-r--r--StarsEx/Player.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/StarsEx/Player.cpp b/StarsEx/Player.cpp
index fffa9a6..091c808 100644
--- a/StarsEx/Player.cpp
+++ b/StarsEx/Player.cpp
@@ -635,19 +635,17 @@ Player::CommandRankRequired(int ship_class)
// +-------------------------------------------------------------------+
int
-Player::GetMissionPoints(ShipStats* s, std::uint32_t start_time)
+Player::GetMissionPoints(ShipStats* s, std::int_fast32_t flight_time_)
{
int result = 0;
if (s) {
result = s->GetPoints();
- int flight_time = (Clock::GetInstance()->GameTime() - start_time) / 1000;
-
// if player survived mission, award one experience point
// for each minute of action, in ten point blocks:
if (!s->GetDeaths() && !s->GetColls()) {
- int minutes = flight_time / 60;
+ int minutes = flight_time_ / 60;
minutes /= 10;
minutes *= 10;
result += minutes;
@@ -669,12 +667,12 @@ Player::GetMissionPoints(ShipStats* s, std::uint32_t start_time)
// +-------------------------------------------------------------------+
void
-Player::ProcessStats(ShipStats* s, std::uint32_t start_time)
+Player::ProcessStats(ShipStats* s, std::int_fast32_t flight_time_)
{
if (!s) return;
int old_rank = Rank();
- int pts = GetMissionPoints(s, start_time);
+ int pts = GetMissionPoints(s, flight_time_);
AddPoints(pts);
AddPoints(s->GetCommandPoints());
@@ -683,7 +681,7 @@ Player::ProcessStats(ShipStats* s, std::uint32_t start_time)
AddLosses(s->GetDeaths());
AddLosses(s->GetColls());
AddMissions(1);
- AddFlightTime((Clock::GetInstance()->GameTime() - start_time) / 1000);
+ AddFlightTime(flight_time_);
int rank = Rank();