Skip to content

Commit e2aae99

Browse files
authored
Revert "Fix #578: doors state with setElementModel (#599)" (#1600)
* Revert "Fix typo in c2dc463" This reverts commit a03f2a9. * Revert "Fix #578: doors state with setElementModel (#599)" This reverts commit c2dc463.
1 parent c79a3ac commit e2aae99

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

Client/mods/deathmatch/logic/CClientVehicle.cpp

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3603,9 +3603,32 @@ void CClientVehicle::Interpolate()
36033603

36043604
void CClientVehicle::GetInitialDoorStates(SFixedArray<unsigned char, MAX_DOORS>& ucOutDoorStates)
36053605
{
3606-
// Keep the bonet and boot intact
3607-
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
3608-
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
3606+
switch (m_usModel)
3607+
{
3608+
case VT_BAGGAGE:
3609+
case VT_BANDITO:
3610+
case VT_BFINJECT:
3611+
case VT_CADDY:
3612+
case VT_DOZER:
3613+
case VT_FORKLIFT:
3614+
case VT_KART:
3615+
case VT_MOWER:
3616+
case VT_QUAD:
3617+
case VT_RCBANDIT:
3618+
case VT_RCCAM:
3619+
case VT_RCGOBLIN:
3620+
case VT_RCRAIDER:
3621+
case VT_RCTIGER:
3622+
case VT_TRACTOR:
3623+
case VT_VORTEX:
3624+
memset(&ucOutDoorStates[0], DT_DOOR_MISSING, MAX_DOORS);
3625+
3626+
// Keep the bonet and boot intact
3627+
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
3628+
break;
3629+
default:
3630+
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
3631+
}
36093632
}
36103633

36113634
void CClientVehicle::SetTargetPosition(const CVector& vecTargetPosition, unsigned long ulDelay, bool bValidVelocityZ, float fVelocityZ)

Server/mods/deathmatch/logic/CVehicle.cpp

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,32 @@ void CVehicle::SetPaintjob(unsigned char ucPaintjob)
804804

805805
void CVehicle::GetInitialDoorStates(SFixedArray<unsigned char, MAX_DOORS>& ucOutDoorStates)
806806
{
807-
// Keep the bonet and boot intact
808-
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
809-
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
807+
switch (m_usModel)
808+
{
809+
case VT_BAGGAGE:
810+
case VT_BANDITO:
811+
case VT_BFINJECT:
812+
case VT_CADDY:
813+
case VT_DOZER:
814+
case VT_FORKLIFT:
815+
case VT_KART:
816+
case VT_MOWER:
817+
case VT_QUAD:
818+
case VT_RCBANDIT:
819+
case VT_RCCAM:
820+
case VT_RCGOBLIN:
821+
case VT_RCRAIDER:
822+
case VT_RCTIGER:
823+
case VT_TRACTOR:
824+
case VT_VORTEX:
825+
memset(&ucOutDoorStates[0], DT_DOOR_MISSING, MAX_DOORS);
826+
827+
// Keep the bonet and boot intact
828+
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
829+
break;
830+
default:
831+
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
832+
}
810833
}
811834

812835
void CVehicle::GenerateHandlingData()

0 commit comments

Comments
 (0)