Skip to content

Commit

Permalink
Update code/game/gamemodes/objectives/traders_objectives.dm
Browse files Browse the repository at this point in the history
ладно

Co-authored-by: KIBORG04 <[email protected]>
  • Loading branch information
Tap0r and KIBORG04 committed Sep 14, 2024
1 parent 9e421c6 commit da49e84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/game/gamemodes/objectives/traders_objectives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
"алтарь священника" = /obj/structure/altar_of_gods)

/datum/objective/trader_purchase/New()
item_name1 = pick(possible_items)
do item_name2 = pick(possible_items)
while(item_name1 == item_name2)
var/indx = rand(1, possible_items.len)
var/offset = rand(1, possible_items.len -1) // -1, чтобы не вступить в тот же элемент
var/new_indx = (indx + offset) % L.len

Check failure on line 63 in code/game/gamemodes/objectives/traders_objectives.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

undefined var: "L"

Check warning on line 63 in code/game/gamemodes/objectives/traders_objectives.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

field access requires static type: "len"
item_name1 = possible_items[indx]
item_name2 = possible_items[new_indx == 0 ? possible_items.len : new_indx] // этот финт, потому что в бъонде листы начинаются с 1
explanation_text = "Достать и притащить на наш шаттл [item_name1] и [item_name2]."

/datum/objective/trader_purchase/check_completion()
Expand Down

0 comments on commit da49e84

Please sign in to comment.