File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1846,7 +1846,7 @@ void Server::SendPlayerHP(u16 peer_id)
1846
1846
{
1847
1847
DSTACK (FUNCTION_NAME);
1848
1848
PlayerSAO *playersao = getPlayerSAO (peer_id);
1849
- // In some rare case, if the player is disconnected
1849
+ // In some rare case if the player is disconnected
1850
1850
// while Lua call l_punch, for example, this can be NULL
1851
1851
if (!playersao)
1852
1852
return ;
@@ -2515,9 +2515,11 @@ void Server::sendDetachedInventories(u16 peer_id)
2515
2515
void Server::DiePlayer (u16 peer_id)
2516
2516
{
2517
2517
DSTACK (FUNCTION_NAME);
2518
-
2519
2518
PlayerSAO *playersao = getPlayerSAO (peer_id);
2520
- assert (playersao);
2519
+ // In some rare cases this can be NULL -- if the player is disconnected
2520
+ // when a Lua function modifies l_punch, for example
2521
+ if (!playersao)
2522
+ return ;
2521
2523
2522
2524
infostream << " Server::DiePlayer(): Player "
2523
2525
<< playersao->getPlayer ()->getName ()
You can’t perform that action at this time.
0 commit comments