Skip to content

Commit

Permalink
makes the config for random loot weight a define instead (#3645)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
fix: no more constant odditys
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Sun-Soaked <45698967+Sun-Soaked@users.noreply.github.com>
  • Loading branch information
FalloutFalcon and Sun-Soaked authored Oct 26, 2024
1 parent 8506ebf commit a0867d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
10 changes: 0 additions & 10 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,3 @@
max_val = 255
config_entry_value = 127
min_val = 127

/**
* A config that skews with the random spawners weights
* If the value is lower than 1, it'll tend to even out the odds
* If higher than 1, it'll lean toward common spawns even more.
*/
/datum/config_entry/number/random_loot_weight_modifier
integer = FALSE
default = 1
min_val = 0.05
5 changes: 3 additions & 2 deletions code/game/objects/effects/spawners/random.dm/random.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define RANDOM_LOOT_WEIGHT_MODIFIER 1

/**
* Base class for all random spawners.
*/
Expand Down Expand Up @@ -54,8 +56,7 @@
if(loot_subtype_path)
loot += subtypesof(loot_subtype_path)

if(CONFIG_GET(number/random_loot_weight_modifier) != 1)
skew_loot_weights(loot, CONFIG_GET(number/random_loot_weight_modifier))
skew_loot_weights(loot, RANDOM_LOOT_WEIGHT_MODIFIER)

if(loot?.len)
var/loot_spawned = 0
Expand Down
5 changes: 0 additions & 5 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,3 @@ BLUESPACE_JUMP_WAIT 12000

## If admins are allowed to use the authentication server as a regular server for testing
AUTH_ADMIN_TESTING

# A config that skews with the random spawners weights
# If the value is lower than 1, it'll tend to even out the odds
# If higher than 1, it'll lean toward common spawns even more.
RANDOM_LOOT_WEIGHT_MODIFIER 1

0 comments on commit a0867d0

Please sign in to comment.