Compare commits

...

3 Commits

Author SHA1 Message Date
Ponk
ceb2866aa1 Merge pull request #214 from leevccc/master #patch
fix: item lock cant extend lock time
2024-02-04 14:22:00 +01:00
leevccc
08b089d9be fix: seal lock cant extend lock time 2024-01-14 22:13:16 +08:00
leevccc
8b254a294e fix: item lock cant extend lock time 2024-01-14 18:15:48 +08:00

View File

@@ -228,10 +228,10 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
return; return;
} }
short flag = eq.getFlag(); short flag = eq.getFlag();
flag |= ItemConstants.LOCK; if (eq.getExpiration() > -1 && (eq.getFlag() & ItemConstants.LOCK) != ItemConstants.LOCK) {
if (eq.getExpiration() > -1) {
return; //No perma items pls return; //No perma items pls
} }
flag |= ItemConstants.LOCK;
eq.setFlag(flag); eq.setFlag(flag);
long period = 0; long period = 0;
@@ -246,7 +246,8 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
} }
if (period > 0) { if (period > 0) {
eq.setExpiration(currentServerTime() + DAYS.toMillis(period)); long expiration = eq.getExpiration() > -1 ? eq.getExpiration() : currentServerTime();
eq.setExpiration(expiration + DAYS.toMillis(period));
} }
// double-remove found thanks to BHB // double-remove found thanks to BHB