Skip to content

Commit

Permalink
Update libopenage/pathfinding/cost_field.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Heine <6852422+heinezen@users.noreply.github.com>
  • Loading branch information
dmwever and heinezen authored Jan 29, 2025
1 parent 6f1eaeb commit 9e7aaa7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libopenage/pathfinding/cost_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ bool CostField::stamp(size_t idx, cost_t cost, const time::time_t &stamped_at) {
}

bool CostField::unstamp(size_t idx, const time::time_t &unstamped_at) {
if (!this->cost_stamps[idx].has_value() || unstamped_at < this->cost_stamps[idx]->stamp_time) return false;
if (not this->cost_stamps[idx].has_value() or unstamped_at < this->cost_stamps[idx]->stamp_time) {
return false;
}

cost_t original_cost = cost_stamps[idx]->original_cost;

Expand Down

0 comments on commit 9e7aaa7

Please sign in to comment.