Browse Source

fix nil pointer check for player

master
nichtsen 3 years ago
parent
commit
979ec039b8
  1. 2
      zinx_app_demo/mmo_game/server.go

2
zinx_app_demo/mmo_game/server.go

@ -41,7 +41,7 @@ func OnConnectionLost(conn ziface.IConnection) {
player := core.WorldMgrObj.GetPlayerByPID(pID.(int32)) player := core.WorldMgrObj.GetPlayerByPID(pID.(int32))
//触发玩家下线业务 //触发玩家下线业务
if pID != nil {
if player != nil {
player.LostConnection() player.LostConnection()
} }

Loading…
Cancel
Save