diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-09-11 16:52:07 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-09-11 16:52:07 +0200 |
commit | c86c9b3118d0d489892e7859ee6b1271c86312d8 (patch) | |
tree | 53c6e87b7f1318ffadf13f38b202ef4c55c8b19a /src/vehicles | |
parent | ccarctrl (diff) | |
parent | Merge pull request #202 from erorcun/erorcun (diff) | |
download | re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar.gz re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar.bz2 re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar.lz re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar.xz re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.tar.zst re3-c86c9b3118d0d489892e7859ee6b1271c86312d8.zip |
Diffstat (limited to 'src/vehicles')
-rw-r--r-- | src/vehicles/Automobile.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 5a788945..2ec49710 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -3668,12 +3668,11 @@ CAutomobile::IsDoorReady(eDoors door) if(Doors[door].IsClosed() || IsDoorMissing(door)) return true; int doorflag = 0; - // TODO: enum? switch(door){ - case DOOR_FRONT_LEFT: doorflag = 1; break; - case DOOR_FRONT_RIGHT: doorflag = 4; break; - case DOOR_REAR_LEFT: doorflag = 2; break; - case DOOR_REAR_RIGHT: doorflag = 8; break; + case DOOR_FRONT_LEFT: doorflag = CAR_DOOR_FLAG_LF; break; + case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break; + case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break; + case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break; } return (doorflag & m_nGettingInFlags) == 0; } @@ -4076,7 +4075,7 @@ CAutomobile::ProcessAutoBusDoors(void) if(CTimer::GetTimeInMilliseconds() < m_nBusDoorTimerEnd){ if(m_nBusDoorTimerEnd != 0 && CTimer::GetTimeInMilliseconds() > m_nBusDoorTimerEnd-500){ // close door - if(!IsDoorMissing(DOOR_FRONT_LEFT) && (m_nGettingInFlags & 1) == 0){ + if(!IsDoorMissing(DOOR_FRONT_LEFT) && (m_nGettingInFlags & CAR_DOOR_FLAG_LF) == 0){ if(IsDoorClosed(DOOR_FRONT_LEFT)){ m_nBusDoorTimerEnd = CTimer::GetTimeInMilliseconds(); OpenDoor(CAR_DOOR_LF, DOOR_FRONT_LEFT, 0.0f); @@ -4086,7 +4085,7 @@ CAutomobile::ProcessAutoBusDoors(void) } } - if(!IsDoorMissing(DOOR_FRONT_RIGHT) && (m_nGettingInFlags & 4) == 0){ + if(!IsDoorMissing(DOOR_FRONT_RIGHT) && (m_nGettingInFlags & CAR_DOOR_FLAG_RF) == 0){ if(IsDoorClosed(DOOR_FRONT_RIGHT)){ m_nBusDoorTimerEnd = CTimer::GetTimeInMilliseconds(); OpenDoor(CAR_DOOR_RF, DOOR_FRONT_RIGHT, 0.0f); @@ -4099,9 +4098,9 @@ CAutomobile::ProcessAutoBusDoors(void) }else{ // ended if(m_nBusDoorTimerStart){ - if(!IsDoorMissing(DOOR_FRONT_LEFT) && (m_nGettingInFlags & 1) == 0) + if(!IsDoorMissing(DOOR_FRONT_LEFT) && (m_nGettingInFlags & CAR_DOOR_FLAG_LF) == 0) OpenDoor(CAR_DOOR_LF, DOOR_FRONT_LEFT, 0.0f); - if(!IsDoorMissing(DOOR_FRONT_RIGHT) && (m_nGettingInFlags & 4) == 0) + if(!IsDoorMissing(DOOR_FRONT_RIGHT) && (m_nGettingInFlags & CAR_DOOR_FLAG_RF) == 0) OpenDoor(CAR_DOOR_RF, DOOR_FRONT_RIGHT, 0.0f); m_nBusDoorTimerStart = 0; m_nBusDoorTimerEnd = 0; |