Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Fix scales on player-owned BattleNpcs (Eos, Carbuncle, etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenrei committed Aug 27, 2022
1 parent f92d559 commit 58e3afe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CustomizePlus/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ public static void LoadConfig()

public static unsafe void Update()
{
//Determine player object for root scale behavior later. Have to catch errors for zone transitions.
uint playerObjId = 0;
try
{
playerObjId = ObjectTable[0].ObjectId;
} catch (Exception ex) { }

for (var i = 0; i < ObjectTable.Length; i++)
{
// Always filler Event obj
Expand Down Expand Up @@ -203,8 +210,9 @@ public static unsafe void Update()
// No scale to apply, move on.
if (scale == null)
continue;
// Don't apply root scales to NPCs in cutscenes or battle NPCs. Both cause animation or camera issues.
scale.Apply(obj, !(isCutsceneNpc || (obj.ObjectKind == ObjectKind.BattleNpc)));
// Don't apply root scales to NPCs in cutscenes or battle NPCs. Both cause animation or camera issues. Exception made for player pets
bool applyRootScale = !(isCutsceneNpc || (obj.ObjectKind == ObjectKind.BattleNpc && obj.OwnerId != playerObjId));
scale.Apply(obj, applyRootScale);
}
catch (Exception ex)
{
Expand Down

0 comments on commit 58e3afe

Please sign in to comment.