| 355 | } |
| 356 | |
| 357 | void DisplayArcadeUnit::UpdateVehicles(CCombo* combo, const char* vehicle) |
| 358 | { |
| 359 | bool isVehicle = vehicle && *vehicle; |
| 360 | |
| 361 | CCombo* combo2 = dynamic_cast<CCombo*>(GetCtrl(IDC_ARCUNIT_SIDE)); |
| 362 | PoseidonAssert(combo2); |
| 363 | int side = combo2->GetValue(combo2->GetCurSel()); |
| 364 | |
| 365 | combo2 = dynamic_cast<CCombo*>(GetCtrl(IDC_ARCUNIT_CLASS)); |
| 366 | PoseidonAssert(combo2); |
| 367 | int sel2 = combo2->GetCurSel(); |
| 368 | if (sel2 < 0) |
| 369 | { |
| 370 | return; |
| 371 | } |
| 372 | RString vehicleClass = combo2->GetData(sel2); |
| 373 | |
| 374 | combo->ClearStrings(); |
| 375 | const ParamClass* cls = Pars.GetClass("CfgVehicles"); |
| 376 | RString firstVehicle; |
| 377 | for (int i = 0; i < cls->GetEntryCount(); i++) |
| 378 | { |
| 379 | const ParamEntry& vehEntry = cls->GetEntry(i); |
| 380 | const ParamClass* vehCls = dynamic_cast<const ParamClass*>(&vehEntry); |
| 381 | if (!vehCls) |
| 382 | { |
| 383 | continue; |
| 384 | } |
| 385 | int scope = vehEntry >> "scope"; |
| 386 | if (scope != 2) |
| 387 | { |
| 388 | continue; |
| 389 | } |
| 390 | int vehSide = vehEntry >> "side"; |
| 391 | if (side == TEmpty) |
| 392 | { |
| 393 | if (vehSide == TLogic) |
| 394 | { |
| 395 | continue; |
| 396 | } |
| 397 | if (vehCls->IsDerivedFrom(*cls->GetClass("Man"))) |
| 398 | { |
| 399 | continue; |
| 400 | } |
| 401 | } |
| 402 | else if (side != vehSide) |
| 403 | { |
| 404 | continue; |
| 405 | } |
| 406 | |
| 407 | RString name = vehEntry >> "vehicleClass"; |
| 408 | if (name.GetLength() == 0) |
| 409 | { |
| 410 | continue; |
| 411 | } |
| 412 | if (strcmp(name, vehicleClass) != 0) |
| 413 | { |
| 414 | continue; |
nothing calls this directly
no test coverage detected