Skip to content

Commit

Permalink
Attempt to fix dupe with vend_delay and free essentials from loadout …
Browse files Browse the repository at this point in the history
…vendor. (#417)

* should fix dupes

probably

* fuck this shit

* Update loadout_seller.dm

* Update loadout_seller.dm

Signed-off-by: Helg2 <[email protected]>

* Update loadout_seller.dm

Signed-off-by: Helg2 <[email protected]>

* Update loadout_seller.dm

* Update loadout_seller.dm

* Update loadout_seller.dm

---------

Signed-off-by: Helg2 <[email protected]>
  • Loading branch information
Helg2 authored Oct 13, 2024
1 parent ef5f0c2 commit c9bdd68
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions code/datums/loadout/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
ui.user.balloon_alert(ui.user, "The vendor is still reloading")
return
var/datum/loadout_seller/seller = new (loadout_vendor.faction)
if(seller.try_to_equip_loadout(src, ui.user))
TIMER_COOLDOWN_START(ui.user, COOLDOWN_LOADOUT_EQUIPPED, 30 SECONDS)
seller.try_to_equip_loadout(src, ui.user)
TIMER_COOLDOWN_START(ui.user, COOLDOWN_LOADOUT_EQUIPPED, 30 SECONDS)
ui.close()
if("overwriteLoadout")
item_list = list()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/loadout/loadout_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@
return
switch(action)
if("saveLoadout")
if(length(loadouts_data) >= MAXIMUM_LOADOUT * 2)
to_chat(ui.user, span_warning("You've reached the maximum number of loadouts saved, please delete some before saving new ones"))
if(length(loadouts_data) >= MAXIMUM_LOADOUT)
to_chat(ui.user, span_warning("You've reached the maximum number of loadouts saved, please delete some before saving new ones."))
return
var/loadout_name = params["loadout_name"]
if(isnull(loadout_name))
return
var/loadout_job = params["loadout_job"]
for(var/loadout_data in loadouts_data)
if(loadout_data[1] == loadout_job && loadout_data[2] == loadout_name)
to_chat(ui.user, span_warning("Loadout [loadout_name] for [loadout_job] already exists. Try another name"))
to_chat(ui.user, span_warning("Loadout [loadout_name] for [loadout_job] already exists. Try another name."))
return
var/datum/loadout/loadout = create_empty_loadout(loadout_name, loadout_job)
loadout.save_mob_loadout(ui.user)
Expand Down
5 changes: 3 additions & 2 deletions code/datums/loadout/loadout_seller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@
sell_rest_of_essential_kit(loadout, user)

/// If one item from essential kit was bought, we sell the rest and put in on the ground
/datum/loadout_seller/proc/sell_rest_of_essential_kit(datum/loadout/loadout, mob/user)
/datum/loadout_seller/proc/sell_rest_of_essential_kit(datum/loadout/loadout, mob/living/user)
if(loadout.job != user.job.title)
loadout.job = user.job.title
var/list/job_specific_list = GLOB.loadout_role_essential_set[loadout.job]
for(var/key in job_specific_list)
var/item_already_sold = unique_items_list[key]
while(item_already_sold < job_specific_list[key])
var/obj/item/item = key
new item(user.loc)
item_already_sold++

2 changes: 2 additions & 0 deletions code/game/objects/machinery/vending/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@
sleep(delay_vending)
else
return
if(R.amount <= 0)
return
SSblackbox.record_feedback(FEEDBACK_TALLY, "vendored", 1, R.product_name)
addtimer(CALLBACK(src, PROC_REF(stock_vacuum)), 2.5 MINUTES, TIMER_UNIQUE | TIMER_OVERRIDE) // We clean up some time after the last item has been vended.
if(vending_sound)
Expand Down

0 comments on commit c9bdd68

Please sign in to comment.