fix: item lock cant extend lock time

This commit is contained in:
leevccc
2024-01-14 18:15:48 +08:00
parent 058f034c2b
commit 8b254a294e

View File

@@ -229,7 +229,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
}
short flag = eq.getFlag();
flag |= ItemConstants.LOCK;
if (eq.getExpiration() > -1) {
if (eq.getExpiration() > -1 && (eq.getFlag() & ItemConstants.LOCK) != ItemConstants.LOCK) {
return; //No perma items pls
}
eq.setFlag(flag);
@@ -246,7 +246,8 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
}
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