[No GBP] Fixes a slime speed config and ai controller null error in slime nutrition handling (#82330)

## About The Pull Request

Someone has linked the runtimes logs of round 226376 to show off a
runtime, and I took a look, and found some unrelated runtimes in slime
code.

- The config file for slime slowdown was still using the simple_animal
path. This has been fixed.
- Somehow, a grey slime has lost its AI controller, and when it got
hungry, it runtimed. For now, a coalesce operator has been put in place.
Later, an investigation is needed to figure out where did its AI
controller go.

## Why It's Good For The Game

Runtimes bad.

## Changelog

🆑
fix: Slime properly load their slowdown values from the config files.
fix: Slimes who lose their AI controller will no longer runtime when
they get hungry.
/🆑
This commit is contained in:
Profakos
2024-03-31 14:20:15 -06:00
committed by GitHub
parent fc946edc4a
commit 12a72e6902
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -43,17 +43,17 @@
adjust_nutrition((life_stage == SLIME_LIFE_STAGE_ADULT ? -1 : -0.5) * seconds_per_tick)
if(nutrition < SLIME_STARVE_NUTRITION)
ai_controller.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_STARVING)
ai_controller?.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_STARVING)
if(SPT_PROB(0.5, seconds_per_tick) && LAZYLEN(ai_controller?.blackboard[BB_FRIENDS_LIST]))
var/your_fault = pick(ai_controller?.blackboard[BB_FRIENDS_LIST])
unfriend(your_fault)
else if(nutrition < SLIME_HUNGER_NUTRITION || (nutrition < SLIME_GROW_NUTRITION && SPT_PROB(25, seconds_per_tick)) )
ai_controller.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_HUNGRY)
ai_controller?.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_HUNGRY)
else
ai_controller.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_NONE)
ai_controller?.set_blackboard_key(BB_SLIME_HUNGER_LEVEL, SLIME_HUNGER_NONE)
if(nutrition == 0) //adjust nutrition ensures it can't go below 0
if(SPT_PROB(50, seconds_per_tick))