Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix #578: doors state with setElementModel (#599)" #1600

Merged
merged 2 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions Client/mods/deathmatch/logic/CClientVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3603,9 +3603,32 @@ void CClientVehicle::Interpolate()

void CClientVehicle::GetInitialDoorStates(SFixedArray<unsigned char, MAX_DOORS>& ucOutDoorStates)
{
// Keep the bonet and boot intact
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
switch (m_usModel)
{
case VT_BAGGAGE:
case VT_BANDITO:
case VT_BFINJECT:
case VT_CADDY:
case VT_DOZER:
case VT_FORKLIFT:
case VT_KART:
case VT_MOWER:
case VT_QUAD:
case VT_RCBANDIT:
case VT_RCCAM:
case VT_RCGOBLIN:
case VT_RCRAIDER:
case VT_RCTIGER:
case VT_TRACTOR:
case VT_VORTEX:
memset(&ucOutDoorStates[0], DT_DOOR_MISSING, MAX_DOORS);

// Keep the bonet and boot intact
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
break;
default:
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
}
}

void CClientVehicle::SetTargetPosition(const CVector& vecTargetPosition, unsigned long ulDelay, bool bValidVelocityZ, float fVelocityZ)
Expand Down
29 changes: 26 additions & 3 deletions Server/mods/deathmatch/logic/CVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,32 @@ void CVehicle::SetPaintjob(unsigned char ucPaintjob)

void CVehicle::GetInitialDoorStates(SFixedArray<unsigned char, MAX_DOORS>& ucOutDoorStates)
{
// Keep the bonet and boot intact
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
switch (m_usModel)
{
case VT_BAGGAGE:
case VT_BANDITO:
case VT_BFINJECT:
case VT_CADDY:
case VT_DOZER:
case VT_FORKLIFT:
case VT_KART:
case VT_MOWER:
case VT_QUAD:
case VT_RCBANDIT:
case VT_RCCAM:
case VT_RCGOBLIN:
case VT_RCRAIDER:
case VT_RCTIGER:
case VT_TRACTOR:
case VT_VORTEX:
memset(&ucOutDoorStates[0], DT_DOOR_MISSING, MAX_DOORS);

// Keep the bonet and boot intact
ucOutDoorStates[0] = ucOutDoorStates[1] = DT_DOOR_INTACT;
break;
default:
memset(&ucOutDoorStates[0], DT_DOOR_INTACT, MAX_DOORS);
}
}

void CVehicle::GenerateHandlingData()
Expand Down