diff --git a/scripts/commands/stopdance.py b/scripts/commands/stopdance.py index cf33fd33..ed2b7a44 100644 --- a/scripts/commands/stopdance.py +++ b/scripts/commands/stopdance.py @@ -5,8 +5,9 @@ def setup(): def run(core, actor, target, commandString): entSvc = core.entertainmentService + perf = entSvc.getPerformanceByIndex(actor.getPerformanceId()) - if actor.getPosture() != 0x09 or actor.getPerformanceId() > 0: + if actor.getPosture() != 0x09 or not perf or perf.getDanceVisualId() < 0: actor.sendSystemMessage('@performance:dance_not_performing', 0) return diff --git a/scripts/commands/watch.py b/scripts/commands/watch.py index bc75010d..5658d8fb 100644 --- a/scripts/commands/watch.py +++ b/scripts/commands/watch.py @@ -14,7 +14,11 @@ def run(core, actor, target, commandString): actor.sendSystemMessage('@performance:dance_watch_npc') return - if target.getPosture() != 0x09 or target.getPerformanceId() >0: + + entSvc = core.entertainmentService + perf = entSvc.getPerformanceByIndex(target.getPerformanceId()) + + if target.getPosture() != 0x09 or not perf or perf.getDanceVisualId() < 0: actor.sendSystemMessage('@performance:dance_watch_not_dancing',0) return diff --git a/src/services/EntertainmentService.java b/src/services/EntertainmentService.java index db255217..bc564664 100644 --- a/src/services/EntertainmentService.java +++ b/src/services/EntertainmentService.java @@ -299,6 +299,10 @@ public class EntertainmentService implements INetworkDispatch { return performances.get(name); } + public Performance getPerformanceByIndex(int index) { + return performancesByIndex.get(index); + } + public void startPerformance(CreatureObject actor, int performanceId, int performanceCounter, String skillName, boolean isDance) { actor.setPerformanceId(performanceId, isDance); actor.setPerformanceCounter(performanceCounter);