Stops a player from observing
| 3550 | |
| 3551 | // Stops a player from observing |
| 3552 | void 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 |
no test coverage detected