Skip to content

Commit

Permalink
Fixed false positive charge skill hitTime logs
Browse files Browse the repository at this point in the history
Charge skills boosted by cast speed would lose their boost, depending on the cast duration
  • Loading branch information
neon-dev committed Nov 11, 2024
1 parent 1f9adbe commit b96b0e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,11 @@ public SkillTemplate getLastSkill() {
}

public boolean isHitTimeBoosted() {
return System.currentTimeMillis() <= hitTimeBoostExpireTimeMillis;
return isHitTimeBoosted(System.currentTimeMillis());
}

public boolean isHitTimeBoosted(long timeMillis) {
return timeMillis <= hitTimeBoostExpireTimeMillis;
}

public float getHitTimeBoostCastSpeed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public boolean useSkill() {
effector.getObserveController().notifyStartSkillCastObservers(this);
effector.setCasting(this);
effector.getObserveController().attach(moveListener);
// motion boost state from the charge starting time must not get lost
if (effector instanceof Player player && player.isHitTimeBoosted(player.getCastingSkill().getCastStartTime()))
player.setHitTimeBoost(System.currentTimeMillis() + 100, player.getHitTimeBoostCastSpeed());
updateCastDurationAndSpeed();
updateHitTime(SecurityConfig.CHECK_ANIMATIONS);
endCast();
Expand Down

0 comments on commit b96b0e9

Please sign in to comment.