Page 1 of 1

Detecting editor mode

Posted: Tue Nov 19, 2019 10:13 am
by Pi-C
Is there a way to detect whether a game is currently running in /editor mode? A user reported a crash with GCKI:

Code: Select all

Error while running event GCKI::on_player_driving_changed_state (ID 26)
LuaPlayer doesn't contain key player.
Trying out the editor mode for the first time, I got another crash:

Code: Select all

Error while running event GCKI::on_built_entity (ID 6)
No character.
Both crashes seem to be related in that there is no character or player entity in the editor mode, so I think it would help if my mod would ignore any events that get triggered in this mode. Can that be done?

Re: Detecting editor mode

Posted: Tue Nov 19, 2019 10:15 am
by Klonan
You can just check if the character is nil

Re: Detecting editor mode

Posted: Tue Nov 19, 2019 10:17 am
by Pi-C
Right. Guess that was a bit too obvious. Thanks! :-)