Skip to content

Commit

Permalink
medical: Make sure currentWound doesn't wrap around to 0 when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
dastrukar authored and caligari87 committed Sep 27, 2023
1 parent 0cd3428 commit e409170
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions medical/module/medical_tool.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class UaS_MedicalToolInfo : Inventory {
}

override void DoEffect() {
// Make sure currentWoundIdx doesn't wrap around to 0 when updating
if (wh && wh.critwounds.Size() > 0) { currentWoundIdx = min(currentWoundIdx, wh.critwounds.Size() - 1); }
if (!currentWound) { UpdateCurrentWound(currentWoundIdx); }
}

Expand Down

0 comments on commit e409170

Please sign in to comment.