| 250 | } |
| 251 | |
| 252 | void PlayerLeftMsg(int pnum, bool left) |
| 253 | { |
| 254 | Player &player = Players[pnum]; |
| 255 | |
| 256 | if (&player == InspectPlayer) |
| 257 | InspectPlayer = MyPlayer; |
| 258 | |
| 259 | if (&player == MyPlayer) |
| 260 | return; |
| 261 | if (!player.plractive) |
| 262 | return; |
| 263 | |
| 264 | FixPlrWalkTags(player); |
| 265 | RemovePortalMissile(pnum); |
| 266 | DeactivatePortal(pnum); |
| 267 | delta_close_portal(pnum); |
| 268 | RemovePlrMissiles(player); |
| 269 | if (left) { |
| 270 | string_view pszFmt = _("Player '{:s}' just left the game"); |
| 271 | switch (sgdwPlayerLeftReasonTbl[pnum]) { |
| 272 | case LEAVE_ENDING: |
| 273 | pszFmt = _("Player '{:s}' killed Diablo and left the game!"); |
| 274 | gbSomebodyWonGameKludge = true; |
| 275 | break; |
| 276 | case LEAVE_DROP: |
| 277 | pszFmt = _("Player '{:s}' dropped due to timeout"); |
| 278 | break; |
| 279 | } |
| 280 | EventPlrMsg(fmt::format(fmt::runtime(pszFmt), player._pName)); |
| 281 | } |
| 282 | player.plractive = false; |
| 283 | player._pName[0] = '\0'; |
| 284 | ResetPlayerGFX(player); |
| 285 | gbActivePlayers--; |
| 286 | } |
| 287 | |
| 288 | void ClearPlayerLeftState() |
| 289 | { |
no test coverage detected