mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-23 11:50:04 +00:00
implemented checking vehicle time limit on use
This commit is contained in:
parent
076f89927d
commit
09f1f67778
@ -691,7 +691,7 @@ void PlayerManager::revivePlayer(CNSocket* sock, CNPacketData* data) {
|
||||
void PlayerManager::enterPlayerVehicle(CNSocket* sock, CNPacketData* data) {
|
||||
PlayerView& plr = PlayerManager::players[sock];
|
||||
|
||||
if (plr.plr->Equip[8].iID > 0) {
|
||||
if (plr.plr->Equip[8].iID > 0 && plr.plr->Equip[8].iTimeLimit>(getTimestamp()/1000)) {
|
||||
INITSTRUCT(sP_FE2CL_PC_VEHICLE_ON_SUCC, response);
|
||||
sock->sendPacket((void*)&response, P_FE2CL_PC_VEHICLE_ON_SUCC, sizeof(sP_FE2CL_PC_VEHICLE_ON_SUCC));
|
||||
|
||||
@ -709,6 +709,14 @@ void PlayerManager::enterPlayerVehicle(CNSocket* sock, CNPacketData* data) {
|
||||
} else {
|
||||
INITSTRUCT(sP_FE2CL_PC_VEHICLE_ON_FAIL, response);
|
||||
sock->sendPacket((void*)&response, P_FE2CL_PC_VEHICLE_ON_FAIL, sizeof(sP_FE2CL_PC_VEHICLE_ON_FAIL));
|
||||
|
||||
//check if vehicle didn't expire
|
||||
if (plr.plr->Equip[8].iTimeLimit < (getTimestamp() / 1000))
|
||||
{
|
||||
plr.plr->toRemoveVehicle.eIL = 0;
|
||||
plr.plr->toRemoveVehicle.iSlotNum = 8;
|
||||
ItemManager::checkItemExpire(sock, plr.plr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user