fix UB and potential crashes when doing ice cream

This commit is contained in:
withmorten 2021-02-02 11:27:30 +01:00
parent 1eb77c4d6d
commit 4281730b16
1 changed files with 4 additions and 0 deletions

View File

@ -113,7 +113,11 @@ const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicl
CVehicleToEffect effect(pVehicle);
vVehicleToEffect.push_back(effect);
POP_MEMID();
#ifdef FIX_BUGS
return vVehicleToEffect.back().ChooseEffect(pos);
#else
return effect.ChooseEffect(pos);
#endif
}
CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect)