diff --git a/hunger/module/consumable/consumable_input.zsc b/hunger/module/consumable/consumable_input.zsc index 469c035b..dd05e0ef 100644 --- a/hunger/module/consumable/consumable_input.zsc +++ b/hunger/module/consumable/consumable_input.zsc @@ -31,6 +31,9 @@ extend class UaS_Consumable { CHAN_WEAPON, CHANF_OVERLAP, attenuation: ATTN_STATIC); weaponstatus[UGCS_OPEN] = UGCSF_OPENED; + if (weaponstatus[UGCS_LASTSPOILTIME] == -1) { + weaponstatus[UGCS_LASTSPOILTIME] = level.totaltime; + } owner.A_Log(string.format("Opened %s. %s", gettag(), RandomOpenMessage()), true); GiveContents(); } diff --git a/hunger/module/consumable/consumable_misc.zsc b/hunger/module/consumable/consumable_misc.zsc index e7330d17..c37d4521 100644 --- a/hunger/module/consumable/consumable_misc.zsc +++ b/hunger/module/consumable/consumable_misc.zsc @@ -47,6 +47,7 @@ extend class UaS_Consumable { // 10% minor contamination +2 // 20% basic spoilage +1 // 60% nothing + if (weaponstatus[UGCS_LASTSPOILTIME] == -1) { return; } if (weaponstatus[UGCS_LASTSPOILTIME] < level.totaltime) { // Spoilage from external contamination if open if (weaponstatus[UGCS_OPEN] == UGCSF_OPENED) { @@ -105,6 +106,7 @@ extend class UaS_Consumable { weaponstatus[UGCS_SPOILAGE] = random(0,100) * (frandom(0,1) * frandom(0,1)); weaponstatus[UGCS_LASTSPOILTIME] = level.totaltime; } + else { weaponstatus[UGCS_LASTSPOILTIME] = -1; } } override void PostBeginPlay() {