Piggy3590 / LC_Office

2 stars 0 forks source link

[1.0.3] Shimp Bestiary Entry Issue #9

Open SeedyMcSeedface opened 5 months ago

SeedyMcSeedface commented 5 months ago

While I was working to figure out what was breaking the terminal entirely with lammOS, it was found that the code adds the Shimp's bestiary entry twice, resulting in there being two identical entries.

lammas321 commented 5 months ago

For more detail on why this happens, within your mod's Awake method you call the Enemies.RegisterEnemy LethalLib method with the terminal bestiary entry for the Shrimp entity in the parameters, and LethalLib later adds it to the list of bestiary entries. But then after LethalLib has added the bestiary entry, you later add the bestiary entry again in your prefix patch for the Terminal.Start method, causing there to be 2 entries that are exactly identical.

This is what led to the error that SeedyMcSeedface was encountering with lammOS, as it wasn't expecting to find multiple bestiary entries with the same name. I will be adding a check to make sure that things like this don't cause errors for lammOS in the future, but I recommend removing your prefix patch for the Terminal.Start method to prevent other unexpected behavior with having two identical bestiary entries.