Skip to content

Commit

Permalink
medical: Don't rely on LANGUAGE to get blocking item name
Browse files Browse the repository at this point in the history
CheckStrip is still used, but that's only for the worn layers thing
  • Loading branch information
dastrukar committed Oct 14, 2023
1 parent b838ad4 commit 5c53e79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 0 additions & 3 deletions LANGUAGE
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ UI_TRK_2FCARTRIDGE_REFILL = "\cvRefilled staples and biofoam.\nconsumed on
UI_TRK_2FCARTRIDGE_NOCARTRIDGES = "No available auto-suture cartridges.";

// UI: Trauma Kit (worn layer)
// TODO: rewrite code for this thing to not rely on LANGUAGE for item names
UI_TRK_ENVIROSUIT = "environment suit";
UI_TRK_ARMOUR = "armour";
UI_TRK_BANDAGE = "bandage";
UI_TRK_WORNLAYERS = "worn layers";
UI_TRK_TAKEOFF_YOU = "Take off your %s first!\n";
Expand Down
3 changes: 0 additions & 3 deletions medical/language
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ UI_TRK_2FCARTRIDGE_REFILL = "\cvRefilled staples and biofoam.\nconsumed on
UI_TRK_2FCARTRIDGE_NOCARTRIDGES = "No available auto-suture cartridges.";

// UI: Trauma Kit (worn layer)
// TODO: rewrite code for this thing to not rely on LANGUAGE for item names
UI_TRK_ENVIROSUIT = "environment suit";
UI_TRK_ARMOUR = "armour";
UI_TRK_BANDAGE = "bandage";
UI_TRK_WORNLAYERS = "worn layers";
UI_TRK_TAKEOFF_YOU = "Take off your %s first!\n";
Expand Down
7 changes: 4 additions & 3 deletions medical/module/traumakit/traumakit.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,15 @@ class UaS_TraumaKit : UaS_MedicalTool {
bool HandleStrip() {
string itemname, imperative;
// check for intervening items, otherwise exit early
let blockinv = HDWoundFixer.CheckCovered(mti.patient, CHECKCOV_CHECKBODY);
bool intervening = (
!HDPlayerPawn.CheckStrip(mti.patient, mti.patient, false)
blockinv
|| !HDPlayerPawn.CheckStrip(mti.patient, mti.patient, false)
|| (mti.currentWound && mti.currentWound.patched > 0.)
);
if (!intervening) { return true; }

if (mti.patient.countinv("WornRadsuit")) { itemname = Stringtable.Localize("$UI_TRK_ENVIROSUIT"); }
else if (mti.patient.countinv("HDArmourWorn")) { itemname = Stringtable.Localize("$UI_TRK_ARMOUR"); }
if (blockinv) { itemname = blockinv.GetTag(); }
else if (mti.currentWound && mti.currentWound.patched > 0.) { itemname = Stringtable.Localize("$UI_TRK_BANDAGE"); }
else { itemname = Stringtable.Localize("$UI_TRK_WORNLAYERS"); }

Expand Down

0 comments on commit 5c53e79

Please sign in to comment.