mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 21:35:10 +00:00
Fix Rotation Locking
This commit is contained in:
1 parent
4f7773eb3f
commit
55cd8cc5b3
2 files changed
+31
-1
No files matched your search
@@ -117,10 +117,33 @@ public class DataAbilities {
|
||||
* Should be called every tick from onLivingUpdate().
|
||||
*/
|
||||
public void tick() {
|
||||
if (!enabled || npc.worldObj.isRemote || npc.isKilled()) {
|
||||
if (npc.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Force-stop any running ability when NPC is killed or abilities are disabled
|
||||
if (!enabled || npc.isKilled()) {
|
||||
if (currentAbility != null) {
|
||||
removeTelegraph(currentAbility);
|
||||
stopAbilityAnimation();
|
||||
releaseLockedRotation();
|
||||
releaseLockedPosition();
|
||||
currentAbility = null;
|
||||
lastTarget = null;
|
||||
} else {
|
||||
// No ability but locks could be orphaned
|
||||
if (rotationLocked) releaseLockedRotation();
|
||||
if (positionLocked) releaseLockedPosition();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Safety: release orphaned locks if no ability is actively executing
|
||||
if (currentAbility == null || !currentAbility.isExecuting()) {
|
||||
if (rotationLocked) releaseLockedRotation();
|
||||
if (positionLocked) releaseLockedPosition();
|
||||
}
|
||||
|
||||
// Tick current ability if executing
|
||||
if (currentAbility != null && currentAbility.isExecuting()) {
|
||||
tickCurrentAbility();
|
||||
|
||||
Reference in new issue
Block a user