SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

OnPlayerJoined System.NullReferenceException #98

Closed RayFinney closed 10 years ago

RayFinney commented 10 years ago

When i try to use: public void OnPlayerJoined(ulong remoteUserId, CharacterEntity character)

I will get a System.NullReferenceException but its should be right this way isnt it?

DraygoKorvan commented 10 years ago

character is currently a dummy and only has the steamId, so if you try to access other properties the mod can error out with a nullreference. When writing your OnPlayerJoined only use the remoteUserId that it gets for now.

The dev branch changes the OnPlayerJoined to only pass the steamId, removing the CharacterEntity entirely.

chessmaster42 commented 10 years ago

This is completed now that the event no longer passes the entity. The player events only pass the steam id now.