MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / verify

Method verify

Descent3/pilot_class.cpp:329–403  ·  view source on GitHub ↗

This function verifies all the pilot data, making sure nothing is out of whack It will correct any messed data.

Source from the content-addressed store, hash-verified

327// This function verifies all the pilot data, making sure nothing is out of whack
328// It will correct any messed data.
329void pilot::verify(void) {
330 int i;
331 for (i = 0; i < MAX_PRIMARY_WEAPONS; i++) {
332 PrimarySelectList[i] = GetAutoSelectPrimaryWpnIdx(i);
333 }
334 for (i = 0; i < MAX_SECONDARY_WEAPONS; i++) {
335 SecondarySelectList[i] = GetAutoSelectSecondaryWpnIdx(i);
336 }
337
338 gameplay_toggles.guided_mainview = Game_toggles.guided_mainview;
339 gameplay_toggles.show_reticle = Game_toggles.show_reticle;
340 gameplay_toggles.ship_noises = Game_toggles.ship_noises;
341
342 // kill graphical stat for inventory and reset to text version
343 if (hud_graphical_stat & STAT_INVENTORY) {
344 hud_graphical_stat = hud_graphical_stat & (~STAT_INVENTORY);
345 hud_stat = hud_stat | STAT_INVENTORY;
346 }
347
348 key_ramping = Key_ramp_speed;
349
350 /*
351 bool had_to_change = false;
352
353 //first check the ship mode
354 bool found_model = false;
355 for(int i=0;i<MAX_SHIPS;i++){
356 if(Ships[i].used && !stricmp(Ships[i].name,Pilot->ship_model) ){
357 found_model = true;
358 break;
359 }
360 }
361
362 if(!found_model){
363 //we couldn't find the ship model
364 had_to_change = true;
365 strcpy(Pilot->ship_model,DEFAULT_SHIP);
366 }
367
368 //check the custom texture
369 if(Pilot->ship_logo[0]!='\0'){
370 if(cfexist(Pilot->ship_logo)==CF_NOT_FOUND){
371 //couldn't find the custom texture
372 Pilot->ship_logo[0] = '\0';
373 had_to_change = true;
374 }
375 }
376
377 //check audio files
378 if(Pilot->audio1_file[0]!='\0'){
379 if(cfexist(Pilot->audio1_file)==CF_NOT_FOUND){
380 //couldn't find the custom texture
381 Pilot->audio1_file[0] = '\0';
382 had_to_change = true;
383 }
384 }
385
386 if(Pilot->audio2_file[0]!='\0'){

Callers 1

VerifyPilotDataFunction · 0.80

Calls 2

Tested by

no test coverage detected