[MIRROR] Fixed uplink discount stocks affecting normal uplink item stocks [MDB IGNORE] (#22894)

* Fixed uplink discount stocks affecting normal uplink item stocks (#77289)

## About The Pull Request
If an uplink item was discounted and purchased, it would prevent
purchase of the normal-priced uplink item, which is supposed to be
infinitely buyable. This fixes that

Closes #73560

## Why It's Good For The Game
Fixes an oversight in the uplink stock system.

## Changelog
🆑
fix: Fixed being unable to purchase regular-priced uplink items if you
bought the discounted variant of it.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>

* Fixed uplink discount stocks affecting normal uplink item stocks

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
This commit is contained in:
SkyratBot
2023-08-05 21:53:17 -04:00
committed by GitHub
co-authored by Watermelon914 Watermelon914
parent dbd4653fd3
commit 4d88007808
2 changed files with 3 additions and 3 deletions
+2 -3
View File
@@ -234,9 +234,8 @@
var/list/extra_purchasable_stock = list()
var/list/extra_purchasable = list()
for(var/datum/uplink_item/item as anything in uplink_handler.extra_purchasable)
if(item in stock_list)
extra_purchasable_stock[REF(item)] = stock_list[item]
stock_list -= item
if(item.stock_key in stock_list)
extra_purchasable_stock[REF(item)] = stock_list[item.stock_key]
extra_purchasable += list(list(
"id" = item.type,
"name" = item.name,
+1
View File
@@ -12,6 +12,7 @@
uplink_item.limited_stock = limited_stock
if(uplink_item.cost >= 20) //Tough love for nuke ops
discount *= 0.5
uplink_item.stock_key = WEAKREF(uplink_item)
uplink_item.category = category
uplink_item.cost = max(round(uplink_item.cost * (1 - discount)),1)
uplink_item.name += " ([round(((initial(uplink_item.cost)-uplink_item.cost)/initial(uplink_item.cost))*100)]% off!)"