Page 1 of 2

[Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 15:44
by steeffeen
hey there,

i noticed that the attribute PlayerId isn't correctly filled on OnPlayerRemoved events

that's unfortunate because i would like to determine if the player who left was carrying an object and i want to drop it at the players last position but the id isn't correct and the .Player attribute of the objects carried by the player are already Null as soon as he leaves

regards,
steff

//Edit: described my point clearer

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 15:56
by faserg1
I just don't get your point. What do you want to do?

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:05
by steeffeen
i just say that the attribute PlayerId isn't filled correctly
i saved the correct Id before the player left to check it and the ids don't match

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:08
by faserg1
Hm, how did you get that? May I watch on some parts of script?

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:23
by steeffeen
easiest way:

Code: Select all

***OnNewPlayer***
***
log(Player.Id);
***

case CSmModeEvent::EType::OnPlayerRemoved: {
	log(Event.PlayerId);
}
and let a player join and leave

just tested it and the result were these 2 logs
#56623104
#402051488

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:26
by faserg1
Try to put another log:

Code: Select all

log(Event.Player.Id);

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:36
by steeffeen
the player object is already destroyed as soon as the player leaves so we can't access it

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:39
by steeffeen
i just did another test:

- two different player join: two very high ids
- first player leaves: #100
- second player leaves: #100

this just doesn't make sense

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:41
by faserg1
Ok, may you add in OnNewPlayer that log:
Player.User.Id
?

Re: [Bug] OnPlayerRemoved Event PlayerId

Posted: 30 May 2013, 16:52
by steeffeen
uhm...

Code: Select all

log(Player.User.Id);
ended up logging the Login of the player... wtf

//Edit: reported here: forum.maniaplanet.com/viewtopic.php?f=279&t=19854