mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 18:09:44 +00:00
Harden auction display and trader stock init
This commit is contained in:
1 parent
77c8e418eb
commit
d657bab73c
11 files changed
+148
-41
No files matched your search
@@ -58,6 +58,9 @@ public class TraderStock {
|
||||
return pStock.getStock(slot, maxStock[slot]);
|
||||
}
|
||||
|
||||
if (currentStock[slot] < 0) {
|
||||
return maxStock[slot];
|
||||
}
|
||||
return Math.max(0, currentStock[slot]);
|
||||
}
|
||||
|
||||
@@ -83,6 +86,9 @@ public class TraderStock {
|
||||
return pStock.consumeStock(slot, maxStock[slot], amount);
|
||||
}
|
||||
|
||||
if (currentStock[slot] < 0) {
|
||||
currentStock[slot] = maxStock[slot];
|
||||
}
|
||||
if (currentStock[slot] >= amount) {
|
||||
currentStock[slot] -= amount;
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user