Skip to content

Commit

Permalink
Make platforms able to reset
Browse files Browse the repository at this point in the history
platforms apparently are able to run again once reaching the last point. As well, canceling a timer seems to return a 0, not a 1
  • Loading branch information
scooterboo committed Sep 14, 2023
1 parent 2b64814 commit 21ac776
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/java/emu/grasscutter/game/entity/EntityGadget.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ public boolean startPlatform() {
var route = this.getScene().getSceneRouteById(configRoute.getRouteId());
if (route != null) {
var points = route.getPoints();
if (configRoute.getStartIndex() == points.length - 1) {
configRoute.setStartIndex(0);
}
val currIndex = configRoute.getStartIndex();

Position prevpos;
Expand Down Expand Up @@ -301,6 +304,9 @@ public boolean startPlatform() {
}
configRoute.setStartIndex(I);
this.position.set(points[I].getPos());
if(I == points.length - 1) {
configRoute.setStarted(false);
}
},
(int) time));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ public int cancelGroupTimerEvent(int groupID, String source) {

Grasscutter.getLogger()
.warn("trying to cancel a timer that's not active {} {}", groupID, source);
return 1;
return 0;
}

// todo use killed monsters instead of spawned entites for check?
Expand Down

0 comments on commit 21ac776

Please sign in to comment.