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

Function EndPlayerDeath

Descent3/Player.cpp:2440–2483  ·  view source on GitHub ↗

forces an end to the player death sequence

Source from the content-addressed store, hash-verified

2438
2439// forces an end to the player death sequence
2440void 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
2485void MovePlayerToWaypoint(object *objp);
2486

Callers 7

EndLevelFunction · 0.85
RunGameMenuFunction · 0.85
ProcessButtonsFunction · 0.85
ProcessNormalKeyFunction · 0.85
MultiLeaveGameFunction · 0.85
MultiDoRenewPlayerFunction · 0.85
DemoPostPlaybackMenuFunction · 0.85

Calls 11

ObjDeleteFunction · 0.85
SetHUDModeFunction · 0.85
PlayerShipExplodeFunction · 0.85
PlayerStopSoundsFunction · 0.85
ClearTransientObjectsFunction · 0.85
InitPlayerNewShipFunction · 0.85
ResetPlayerObjectFunction · 0.85
DoFOVEventFunction · 0.85
MakePlayerInvulnerableFunction · 0.85
Osiris_CallLevelEventFunction · 0.85

Tested by

no test coverage detected