MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / PlayerLeftMsg

Function PlayerLeftMsg

Source/multi.cpp:252–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void 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
288void ClearPlayerLeftState()
289{

Callers 2

ClearPlayerLeftStateFunction · 0.85
recv_plrinfoFunction · 0.85

Calls 8

FixPlrWalkTagsFunction · 0.85
RemovePortalMissileFunction · 0.85
DeactivatePortalFunction · 0.85
delta_close_portalFunction · 0.85
RemovePlrMissilesFunction · 0.85
EventPlrMsgFunction · 0.85
formatFunction · 0.85
ResetPlayerGFXFunction · 0.85

Tested by

no test coverage detected