Skip to content

Commit

Permalink
refactor: make acquired getter-only
Browse files Browse the repository at this point in the history
  • Loading branch information
midgleyc committed Aug 14, 2022
1 parent 92ed452 commit 36b5073
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/net/sourceforge/kolmafia/request/ZapRequest.java
Expand Up @@ -34,7 +34,7 @@ public class ZapRequest extends GenericRequest {
private static final Map<Integer, List<String>> zapGroups = new HashMap<>();

private AdventureResult item;
public AdventureResult acquired;
private AdventureResult acquired;

public ZapRequest(final AdventureResult item) {
super("wand.php");
Expand Down Expand Up @@ -229,4 +229,8 @@ public static boolean registerRequest(final String urlString) {

return true;
}

public AdventureResult getAcquired() {
return acquired;
}
}
3 changes: 2 additions & 1 deletion src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java
Expand Up @@ -9726,7 +9726,8 @@ public static Value zap(ScriptRuntime controller, Value item) {
var request = new ZapRequest(ItemPool.get((int) item.intValue()));
RequestThread.postRequest(request);

int itemId = request.acquired == null ? -1 : request.acquired.getItemId();
var acquired = request.getAcquired();
int itemId = acquired == null ? -1 : acquired.getItemId();

return DataTypes.makeItemValue(itemId, true);
}
Expand Down

0 comments on commit 36b5073

Please sign in to comment.