Skip to content

Commit

Permalink
Update codes follow CORE changes
Browse files Browse the repository at this point in the history
  • Loading branch information
insthync committed May 28, 2021
1 parent 14cfb31 commit 408690e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Scripts/AimAtCursorPlayerCharacterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,12 @@ public override void UseHotkey(HotkeyType type, string relateId, AimPosition aim
protected void UseSkill(string id, AimPosition aimPosition)
{
BaseSkill skill;
short skillLevel;

if (!GameInstance.Skills.TryGetValue(BaseGameData.MakeDataId(id), out skill) || skill == null ||
!PlayerCharacterEntity.GetCaches().Skills.TryGetValue(skill, out skillLevel))
!PlayerCharacterEntity.GetCaches().Skills.TryGetValue(skill, out _))
return;

bool isAttackSkill = skill.IsAttack();
if (PlayerCharacterEntity.UseSkill(skill.DataId, isLeftHandAttacking, aimPosition) && isAttackSkill)
if (PlayerCharacterEntity.UseSkill(skill.DataId, isLeftHandAttacking, SelectedEntityObjectId, aimPosition) && isAttackSkill)
{
isLeftHandAttacking = !isLeftHandAttacking;
}
Expand Down Expand Up @@ -502,7 +500,7 @@ protected void UseItem(string id, AimPosition aimPosition)
else if (item.IsSkill())
{
bool isAttackSkill = (item as ISkillItem).UsingSkill.IsAttack();
if (PlayerCharacterEntity.UseSkillItem((short)itemIndex, isLeftHandAttacking, aimPosition) && isAttackSkill)
if (PlayerCharacterEntity.UseSkillItem((short)itemIndex, isLeftHandAttacking, SelectedEntityObjectId, aimPosition) && isAttackSkill)
{
isLeftHandAttacking = !isLeftHandAttacking;
}
Expand Down

0 comments on commit 408690e

Please sign in to comment.