Skip to content

Commit

Permalink
fix: ensure vbloods never contains null elements (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkAtra authored May 24, 2024
1 parent 3e09e69 commit 4ade9ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ csharp_new_line_before_finally = false
csharp_space_around_declaration_statements = ignore
csharp_space_after_cast = true
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required
resharper_space_after_cast = true
resharper_csharp_place_attribute_on_same_line = never
resharper_place_field_attribute_on_same_line = never
resharper_place_method_attribute_on_same_line = never
Expand Down
12 changes: 8 additions & 4 deletions character/CharacterInfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ public static List<CharacterResponse> GetCharacters() {
var killedVBloods = new List<VBlood>();
var hasProgression = ProgressionUtility.TryGetProgressionEntity(entityManager, player.VUser.UserEntity, out var progressionEntity);
if (hasProgression) {
ListUtils.Convert(entityManager.GetBuffer<UnlockedVBlood>(progressionEntity))
.ForEach(vBlood => killedVBloods.Add((VBlood)vBlood.VBlood.GuidHash));
foreach (var unlockedVBlood in entityManager.GetBuffer<UnlockedVBlood>(progressionEntity)) {
VBlood? vBlood = (VBlood?) unlockedVBlood.VBlood.GuidHash;
if (vBlood != null) {
killedVBloods.Add((VBlood) vBlood);
}
}
}

return new CharacterResponse(
Name: ((VCharacter)player.VCharacter!).Character.Name.ToString(),
GearLevel: ((VCharacter)player.VCharacter!).getGearLevel(),
Name: ((VCharacter) player.VCharacter!).Character.Name.ToString(),
GearLevel: ((VCharacter) player.VCharacter!).getGearLevel(),
Clan: clan,
KilledVBloods: killedVBloods
);
Expand Down

0 comments on commit 4ade9ec

Please sign in to comment.