Skip to content

Commit

Permalink
fix: weapon draw sync
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Mar 9, 2022
1 parent 8fe7d83 commit d764a31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Code/client/Games/Skyrim/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Inventory Actor::GetInventory() const noexcept
uint32_t ammoId = pAmmo ? pAmmo->formID : 0;
modSystem.GetServerModId(ammoId, inventory.Ammo);

inventory.IsWeaponDrawn = actorState.IsWeaponDrawn();
inventory.IsWeaponDrawn = actorState.IsWeaponFullyDrawn();

return inventory;
}
Expand Down
5 changes: 5 additions & 0 deletions Code/client/Games/Skyrim/Misc/ActorState.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ struct ActorState : IMovementState
return (flags2 >> 5 & 7) >= 3;
}

bool IsWeaponFullyDrawn() const noexcept
{
return (flags2 >> 5 & 7) == 3;
}

bool SetWeaponDrawn(bool aDraw) noexcept;
};
2 changes: 1 addition & 1 deletion Code/client/Services/Generic/CharacterService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ void CharacterService::RequestServerAssignment(entt::registry& aRegistry, const
message.FactionsContent = pActor->GetFactions();
message.AllActorValues = pActor->GetEssentialActorValues();
message.IsDead = pActor->IsDead();
message.IsWeaponDrawn = pActor->actorState.IsWeaponDrawn();
message.IsWeaponDrawn = pActor->actorState.IsWeaponFullyDrawn();

if(isTemporary)
{
Expand Down

0 comments on commit d764a31

Please sign in to comment.