From 076f89927db116e9a8fc474ec1ba8ee30a68914a Mon Sep 17 00:00:00 2001 From: kamilprzyb Date: Tue, 22 Sep 2020 21:49:24 +0200 Subject: [PATCH] changed vehicle iTimeLimit to be stored in seconds instead of miliseconds --- src/Database.cpp | 2 +- src/NPCManager.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Database.cpp b/src/Database.cpp index 99bff3b..a478838 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -611,7 +611,7 @@ void Database::getInventory(Player* player) { } void Database::removeExpiredVehicles(Player* player) { - uint64_t currentTime = getTimestamp(); + int32_t currentTime = getTimestamp()/1000; //remove from bank immediately for (int i = 0; i < ABANK_COUNT; i++) { if (player->Bank[i].iType == 10 && player->Bank[i].iTimeLimit < currentTime) diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index c054dff..0f6d940 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -118,8 +118,7 @@ void NPCManager::npcVendorBuy(CNSocket* sock, CNPacketData* data) { // if vehicle if (req->Item.iType == 10) // set time limit: current time + 7days - req->Item.iTimeLimit = getTimestamp() + 604800; - + req->Item.iTimeLimit = getTimestamp()/1000 + 604800; if (slot != req->iInvenSlotNum) { // possible item stacking?