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

Function PlayerStopObserving

Descent3/Player.cpp:3552–3582  ·  view source on GitHub ↗

Stops a player from observing

Source from the content-addressed store, hash-verified

3550
3551// Stops a player from observing
3552void PlayerStopObserving(int slot) {
3553 // call the event to the multiplayer DLL's so they can do what they need
3554 if (Game_mode & GM_MULTI) {
3555 DLLInfo.me_handle = Objects[Players[slot].objnum].handle;
3556 DLLInfo.it_handle = OBJECT_HANDLE_NONE;
3557 CallGameDLL(EVT_CLIENT_GAMEPLAYEREXITSOBSERVER, &DLLInfo);
3558 }
3559
3560 if (slot == Player_num) {
3561 uint8_t hud_mode;
3562 Current_pilot.get_hud_data(&hud_mode);
3563 AddHUDMessage(TXT_LEAVEOBS);
3564 SetHUDMode((tHUDMode)hud_mode);
3565 } else
3566 AddHUDMessage(TXT_PLYRLEAVEOBS, Players[slot].callsign);
3567
3568 // Stop sounds for this player
3569 PlayerStopSounds(slot);
3570
3571 object *obj = &Objects[Players[slot].objnum];
3572
3573 obj->type = OBJ_PLAYER;
3574 Players[slot].piggy_objnum = -1;
3575
3576 InitPlayerNewShip(slot, INVRESET_ALL);
3577 ResetPlayerObject(slot);
3578
3579 if (Demo_flags == DF_RECORDING) {
3580 DemoWritePlayerTypeChange(slot, true);
3581 }
3582}
3583
3584#define PLAYER_TEXTURE_FPS 8.0f
3585// Sets the players custom texture. If filename=NULL then sets to no texture

Callers 3

ProcessTestKeysFunction · 0.85
MultiDoObserverChangeFunction · 0.85
DemoReadPlayerTypeChangeFunction · 0.85

Calls 8

CallGameDLLFunction · 0.85
AddHUDMessageFunction · 0.85
SetHUDModeFunction · 0.85
PlayerStopSoundsFunction · 0.85
InitPlayerNewShipFunction · 0.85
ResetPlayerObjectFunction · 0.85
get_hud_dataMethod · 0.80

Tested by

no test coverage detected