Skip to content

Commit

Permalink
Fix custom size slider getting stuck at 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurochi51 committed Jul 25, 2024
1 parent f88152c commit cd1b08a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions PetScale/PetScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,16 @@ private unsafe void PopulateDictionary()
{
continue;
}
if (chara.Value->Character.GameObject.ObjectKind is not ObjectKind.BattleNpc || chara.Value->Character.GameObject.OwnerId is 0xE0000000)
if (chara.Value->ObjectKind is not ObjectKind.BattleNpc || chara.Value->OwnerId is 0xE0000000)
{
continue;
}
#if DEBUG
var petName = chara.Value->Character.NameString;
var petName = chara.Value->NameString;
if (!petModelDic.ContainsKey(petName))
{
PetModel? petModel = petModelSet.Contains((PetModel)chara.Value->ModelCharaId) ? (PetModel)chara.Value->Character.CharacterData.ModelCharaId : null;
petModelDic.Add(petName, (petModel, chara.Value->Character.CharacterData.ModelCharaId, Vector3.Zero, Vector3.Zero));
PetModel? petModel = petModelSet.Contains((PetModel)chara.Value->ModelCharaId) ? (PetModel)chara.Value->ModelCharaId : null;
petModelDic.Add(petName, (petModel, chara.Value->ModelCharaId, Vector3.Zero, Vector3.Zero));
}
#endif
if (!petModelSet.Contains((PetModel)chara.Value->ModelCharaId))
Expand All @@ -313,9 +313,9 @@ private unsafe void PopulateDictionary()
{
continue;
}
if (chara.Value->Character.GameObject.ObjectKind is ObjectKind.Pc && chara.Value->Character.GameObject.EntityId is not 0xE0000000)
if (chara.Value->ObjectKind is ObjectKind.Pc && chara.Value->EntityId is not 0xE0000000)
{
foreach (var possiblePair in activePetDictionary.Keys.Where(pet => pet.Value->Character.GameObject.OwnerId == chara.Value->Character.GameObject.EntityId))
foreach (var possiblePair in activePetDictionary.Keys.Where(pet => pet.Value->OwnerId == chara.Value->EntityId))
{
activePetDictionary[possiblePair] = ((Pointer<Character>)(&chara.Value->Character), false);
}
Expand Down Expand Up @@ -353,7 +353,7 @@ private unsafe void ParseDictionary(uint playerEntityId)
if (drawModel is not null && petModelDic.TryGetValue(pet->NameString, out var current))
{
current.scale = drawModel->Scale;
current.scale2 = new Vector3(pet->Character.Scale, pet->Character.ModelScale, pet->Character.VfxScale);
current.scale2 = new Vector3(pet->Scale, pet->ModelScale, pet->VfxScale);
petModelDic[pet->NameString] = current;
}
#endif
Expand All @@ -366,8 +366,8 @@ private unsafe void ParseDictionary(uint playerEntityId)
{
switch (config.FairyState)
{
case PetState.Self when character->GameObject.EntityId == playerEntityId:
case PetState.Others when character->GameObject.EntityId != playerEntityId:
case PetState.Self when character->EntityId == playerEntityId:
case PetState.Others when character->EntityId != playerEntityId:
case PetState.All:
{
utilities.SetScale(pet, 1.5f);
Expand All @@ -390,7 +390,7 @@ private unsafe void ParseDictionary(uint playerEntityId)
break;
}
}
if (ParseStruct(pet, character, pet->Character.CharacterData.ModelCharaId, character->GameObject.EntityId == playerEntityId, allPets))
if (ParseStruct(pet, character, pet->ModelCharaId, character->EntityId == playerEntityId, allPets))
{
activePetDictionary[pair.Key] = (pair.Value.character, true);
}
Expand Down
2 changes: 1 addition & 1 deletion PetScale/Windows/ConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ private void CustomSizeInput(float size, ref float petSize)
}
if (!otherPetSelection.Equals(DefaultPetSelection, StringComparison.Ordinal))
{
if (petSize > Utilities.GetDefaultScale(customPetMap[otherPetSelection], PetSize.Custom) * 4f)
if (petSize > Utilities.GetDefaultScale(customPetMap[otherPetSelection], PetSize.Custom) * 4f && petSize > 4f)
{
petSize = Math.Max(Utilities.GetDefaultScale(customPetMap[otherPetSelection], PetSize.Custom) * 4f, 4f);
}
Expand Down

0 comments on commit cd1b08a

Please sign in to comment.