Unverified Commit ccf182d6 authored by jacky14's avatar jacky14 Committed by GitHub
Browse files

Medicine revival&Login white screen (#1883)

* Update InventorySystem.java

-:[fix] Medicine revival

* Update GameMainQuest.java

-:[fix] Login white screen
parent c51f7610
...@@ -167,7 +167,7 @@ public class GameMainQuest { ...@@ -167,7 +167,7 @@ public class GameMainQuest {
boolean didRewind = false; boolean didRewind = false;
for (GameQuest quest : sortedByOrder) { for (GameQuest quest : sortedByOrder) {
int i = sortedByOrder.indexOf(quest); int i = sortedByOrder.indexOf(quest);
if ( i == sortedByOrder.size()) { if ( (i+1) >= sortedByOrder.size()) {
didRewind = quest.rewind(null); didRewind = quest.rewind(null);
} else { } else {
didRewind = quest.rewind(sortedByOrder.get(i+1)); didRewind = quest.rewind(sortedByOrder.get(i+1));
......
...@@ -778,7 +778,7 @@ public class InventorySystem extends BaseGameSystem { ...@@ -778,7 +778,7 @@ public class InventorySystem extends BaseGameSystem {
} }
int[] satiationParams = itemData.getSatiationParams(); int[] satiationParams = itemData.getSatiationParams();
if (satiationParams != null && target.isPresent()) { if (satiationParams != null && satiationParams.length > 0 && target.isPresent()) {
// Invoke and call player use food event. // Invoke and call player use food event.
var event = new PlayerUseFoodEvent(params.player, itemData, params.targetAvatar.getAsEntity()); event.call(); var event = new PlayerUseFoodEvent(params.player, itemData, params.targetAvatar.getAsEntity()); event.call();
if (event.isCanceled()) return false; if (event.isCanceled()) return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment