diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-09-07 00:27:07 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-09-07 00:27:07 +0200 |
commit | 24d9773ae0ab589a25e455369d9e00a614aed21f (patch) | |
tree | 375f15e45411e4aea71c9c682c674d7bdb519cd5 /src/vehicles/Automobile.cpp | |
parent | Merge pull request #201 from erorcun/erorcun (diff) | |
download | re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar.gz re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar.bz2 re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar.lz re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar.xz re3-24d9773ae0ab589a25e455369d9e00a614aed21f.tar.zst re3-24d9773ae0ab589a25e455369d9e00a614aed21f.zip |
Diffstat (limited to 'src/vehicles/Automobile.cpp')
-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; |