Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- LethalLib NuGet package now ships with xml docs (wow!!)
- Enabled embedded debug symbols for easier to read stacktraces for when LethalLib explodes

### Fixed

- Null checks to avoid errors with loading into lobby with empty MapObjects

## LethalLib [1.0.0]

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion LethalLib/Modules/Enemies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static void AddEnemyToLevel(SpawnableEnemy spawnableEnemy, SelectableLev

string tagName = string.Empty;
bool enemyValidToAdd = spawnableEnemy.levelRarities.ContainsKey(Levels.LevelTypes.All)
|| (spawnableEnemy.customLevelRarities != null && Levels.Compatibility.ContentIncludedToLevelViaTag(spawnableEnemy.customLevelRarities.Keys.ToArray(), level, out tagName))
|| (spawnableEnemy.customLevelRarities != null && spawnableEnemy.customLevelRarities.Keys != null && Levels.Compatibility.ContentIncludedToLevelViaTag(spawnableEnemy.customLevelRarities.Keys.ToArray(), level, out tagName))
|| (isCurrentLevelFromVanilla && spawnableEnemy.levelRarities.ContainsKey(Levels.LevelTypes.Vanilla))
|| (!isCurrentLevelFromVanilla && spawnableEnemy.levelRarities.ContainsKey(Levels.LevelTypes.Modded))
|| (isCurrentLevelFromVanilla && spawnableEnemy.levelRarities.ContainsKey(currentLevelType))
Expand Down
2 changes: 1 addition & 1 deletion LethalLib/Modules/Items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

string tagName = string.Empty;
bool itemValidToAdd = scrapItem.levelRarities.ContainsKey(Levels.LevelTypes.All)
|| (scrapItem.customLevelRarities != null && Levels.Compatibility.ContentIncludedToLevelViaTag(scrapItem.customLevelRarities.Keys.ToArray(), level, out tagName))
|| (scrapItem.customLevelRarities != null && scrapItem.customLevelRarities.Keys != null && Levels.Compatibility.ContentIncludedToLevelViaTag(scrapItem.customLevelRarities.Keys.ToArray(), level, out tagName))
|| (isCurrentLevelFromVanilla && scrapItem.levelRarities.ContainsKey(Levels.LevelTypes.Vanilla))
|| (!isCurrentLevelFromVanilla && scrapItem.levelRarities.ContainsKey(Levels.LevelTypes.Modded))
|| (isCurrentLevelFromVanilla && scrapItem.levelRarities.ContainsKey(currentLevelType))
Expand Down Expand Up @@ -777,7 +777,7 @@
}

///<summary
///This method registers a scrap item to the game, However it allows you to pass rarity tables, instead of just a single rarity.

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'The character(s) ',' cannot be used at this location.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'

Check warning on line 780 in LethalLib/Modules/Items.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has badly formed XML -- 'Missing equals sign between attribute and attribute value.'
///</summary>
public static void RegisterScrap(Item spawnableItem, Dictionary<Levels.LevelTypes, int>? levelRarities = null, Dictionary<string, int>? customLevelRarities = null)
{
Expand Down
6 changes: 3 additions & 3 deletions LethalLib/Modules/MapObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ private static void AddMapObjectToLevel(RegisteredMapObject mapObject, Selectabl

string tagName = string.Empty;
bool mapObjectValidToAdd = mapObject.levels.HasFlag(Levels.LevelTypes.All)
|| Levels.Compatibility.ContentIncludedToLevelViaTag(mapObject.spawnLevelOverrides.ToArray(), level, out tagName)
|| (mapObject.spawnLevelOverrides != null && Levels.Compatibility.ContentIncludedToLevelViaTag(mapObject.spawnLevelOverrides, level, out tagName))
|| (isCurrentLevelFromVanilla && mapObject.levels.HasFlag(Levels.LevelTypes.Vanilla))
|| (!isCurrentLevelFromVanilla && mapObject.levels.HasFlag(Levels.LevelTypes.Modded))
|| (isCurrentLevelFromVanilla && mapObject.levels.HasFlag(currentLevelType))
|| (!isCurrentLevelFromVanilla && mapObject.spawnLevelOverrides.Contains(customName));
|| (!isCurrentLevelFromVanilla && mapObject.spawnLevelOverrides != null && mapObject.spawnLevelOverrides.Contains(customName));

string mapObjectName = "invalid!";
if (mapObject.mapObject != null)
{
mapObjectName = mapObject.mapObject.prefabToSpawn.name;
}
else if (mapObject.outsideObject != null && mapObject.outsideObject != null)
else if (mapObject.outsideObject != null)
{
mapObjectName = mapObject.outsideObject.spawnableObject.prefabToSpawn.name;
}
Expand Down