Jump to content

Malbatross doesn't spawn as intended for the first time


Kairyu
  • Pending

malbatrossspawner component has an issue.
Before Malbatross is killed for the first time, he can only naturally spawn at 1 shoal, instead of at 50% of them (changing the tuning value doesn't change anything as well). It's because TryBeginningMalbatrossSpawns function doesn't update the _shuffled_shoals_for_spawning table if it already exists.

_shuffled_shoals_for_spawning = _shuffled_shoals_for_spawning or shuffledKeys(_fishshoals)

TryBeginningMalbatrossSpawns gets called inside of OnFishShoalAdded (which gets called for every shoal).

So what happens is:

  • game adds 1 shoal
  • TryBeginningMalbatrossSpawns updates the _shuffled_shoals_for_spawning list (since it doesn't exist yet), which ends up having 1 item
  • then game adds another shoal
  • but this time it doesn't get added to _shuffled_shoals_for_spawning, because TryBeginningMalbatrossSpawns doesn't update it
  • it then happens for every consecutive shoal

So at the end, the game only sees one shoal to spawn the boss in.
That also means that if you add a new shoal in the middle of the game, the boss wouldn't be able to spawn at it, since it also calls TryBeginningMalbatrossSpawns. The boss still can be spawned with fishing rod. This gets fixed after killing Malbatros or making them relocate to a different spawner.

Changing the line to

_shuffled_shoals_for_spawning = shuffledKeys(_fishshoals) -- removed "_shuffled_shoals_for_spawning or "

also fixes the bug.

image.png


Steps to Reproduce

The bug is present right at the start of the game.

  • Like 1



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...