forces an end to the player death sequence
| 2438 | |
| 2439 | // forces an end to the player death sequence |
| 2440 | void EndPlayerDeath(int slot) { |
| 2441 | ASSERT(slot >= 0 && slot < MAX_PLAYERS); |
| 2442 | object *playerobj = &Objects[Players[slot].objnum]; |
| 2443 | |
| 2444 | if (slot == Player_num) { |
| 2445 | if (Death[slot].camera) { |
| 2446 | ObjDelete(OBJNUM(Death[slot].camera)); |
| 2447 | Death[slot].camera = NULL; |
| 2448 | Viewer_object = Death[slot].oldviewer; |
| 2449 | } |
| 2450 | SetHUDMode(Death[slot].saved_cockpit); |
| 2451 | ResetPersistentHUDMessage(); |
| 2452 | } |
| 2453 | |
| 2454 | if (!(Players[playerobj->id].flags & PLAYER_FLAGS_DEAD)) |
| 2455 | PlayerShipExplode(playerobj, 50.0f); |
| 2456 | |
| 2457 | // Stop sounds for this player |
| 2458 | PlayerStopSounds(slot); |
| 2459 | |
| 2460 | // Get rid of explosions, weapons etc. that are still alive |
| 2461 | if (!(Game_mode & GM_MULTI)) |
| 2462 | ClearTransientObjects(0); |
| 2463 | |
| 2464 | // Reset the player object |
| 2465 | InitPlayerNewShip(slot, INVRESET_DEATHSPEW); |
| 2466 | ResetPlayerObject(slot); |
| 2467 | |
| 2468 | // Do the zoom-in effect and set him for invulernable in single player |
| 2469 | if (slot == Player_num) { |
| 2470 | float val = FOV_CHANGE_TIME; |
| 2471 | float *valp = &val; |
| 2472 | DoFOVEvent(-1, (void *)valp); |
| 2473 | |
| 2474 | if (!(Game_mode & GM_MULTI)) { |
| 2475 | MakePlayerInvulnerable(slot, 2.0); |
| 2476 | } |
| 2477 | } |
| 2478 | |
| 2479 | // call osiris level event |
| 2480 | tOSIRISEventInfo evt; |
| 2481 | evt.evt_player_respawn.it_handle = Objects[Players[slot].objnum].handle; |
| 2482 | Osiris_CallLevelEvent(EVT_PLAYER_RESPAWN, &evt); |
| 2483 | } |
| 2484 | |
| 2485 | void MovePlayerToWaypoint(object *objp); |
| 2486 |
no test coverage detected