changed vehicle iTimeLimit to be stored in seconds instead of miliseconds

This commit is contained in:
kamilprzyb 2020-09-22 21:49:24 +02:00
parent 7ba9b9a54f
commit 076f89927d
2 changed files with 2 additions and 3 deletions

View File

@ -611,7 +611,7 @@ void Database::getInventory(Player* player) {
} }
void Database::removeExpiredVehicles(Player* player) { void Database::removeExpiredVehicles(Player* player) {
uint64_t currentTime = getTimestamp(); int32_t currentTime = getTimestamp()/1000;
//remove from bank immediately //remove from bank immediately
for (int i = 0; i < ABANK_COUNT; i++) { for (int i = 0; i < ABANK_COUNT; i++) {
if (player->Bank[i].iType == 10 && player->Bank[i].iTimeLimit < currentTime) if (player->Bank[i].iType == 10 && player->Bank[i].iTimeLimit < currentTime)

View File

@ -118,8 +118,7 @@ void NPCManager::npcVendorBuy(CNSocket* sock, CNPacketData* data) {
// if vehicle // if vehicle
if (req->Item.iType == 10) if (req->Item.iType == 10)
// set time limit: current time + 7days // set time limit: current time + 7days
req->Item.iTimeLimit = getTimestamp() + 604800; req->Item.iTimeLimit = getTimestamp()/1000 + 604800;
if (slot != req->iInvenSlotNum) { if (slot != req->iInvenSlotNum) {
// possible item stacking? // possible item stacking?