Open Proxy-99 opened 1 week ago
attempt to fix #3472
Attempt? It should be straightforward for you to test your changes (against the issue repro), please do so.
attempt to fix #3472
Attempt? It should be straightforward for you to test your changes (against the issue repro), please do so.
tested issue gone
attempt to fix #3472
Attempt? It should be straightforward for you to test your changes (against the issue repro), please do so.
the issue with SetSirenActive()
it return true after removing the sirens
which makes the function return false in the second time you fire the SetVehicleSirensOn with same vehicle
bool CStaticFunctionDefinitions::SetVehicleSirensOn(CElement* pElement, bool bSirensOn)
{
assert(pElement);
RUN_CHILDREN(SetVehicleSirensOn(*iter, bSirensOn))
if (IS_VEHICLE(pElement))
{
CVehicle* pVehicle = static_cast<CVehicle*>(pElement);
// Has Sirens and different state than before?
if ((CVehicleManager::HasSirens(pVehicle->GetModel()) || pVehicle->DoesVehicleHaveSirens()) && bSirensOn != pVehicle->IsSirenActive())
{
// Set the new state
pVehicle->SetSirenActive(bSirensOn);
// Tell everyone
unsigned char ucSirensOn = 0;
if (bSirensOn)
ucSirensOn = 1;
CBitStream BitStream;
BitStream.pBitStream->Write(ucSirensOn);
m_pPlayerManager->BroadcastOnlyJoined(CElementRPCPacket(pVehicle, SET_VEHICLE_SIRENE_ON, *BitStream.pBitStream));
return true;
}
}
return false;
}
bSirensOn != pVehicle->IsSirenActive()
will return false in the second time you fire the function with same car
attempt to fix #3472
the issue with SetSirenActive() it return true after removing the sirens deactive the sirens when removing them