ZZ-Cat / raildriver

Smart Locomotive Controller script for Garry's Mod Train Build Servers.
GNU Affero General Public License v3.0
2 stars 0 forks source link

'You can only perform one type of action per tick!' at line 63, char 15 #21

Closed btg611 closed 2 years ago

btg611 commented 2 years ago

Describe the bug Upon spawning the RailDriver script e2, receive error code: sv: Expression 2 (RailDriver): Runtime error 'You can only perform one type of action per tick!' at line 63, char 15, e2 self destructs.

To Reproduce Steps to reproduce the behavior:

  1. Spawn script Error, self destruct
ZZ-Cat commented 2 years ago

Describe the bug Upon spawning the RailDriver script e2, receive error code: sv: Expression 2 (RailDriver): Runtime error 'You can only perform one type of action per tick!' at line 63, char 15, e2 self destructs.

To Reproduce Steps to reproduce the behavior:

1. Spawn script
   Error, self destruct

Interesting. I have a fair idea of what that might be. I just checked the code & it looks to me like it's happening when Smart Entity Management is initializing... or, more accurately, when it's already locked the E2 & it's trying to unlock the E2 in the same execution tick.

In the exception handler, I'm telling the E2 to unlock itself, & as I discovered when I was on the FC&N Server yesterday, calls to lock & unlock the E2 actually fail, if thar called in the same tick cycle. Although, in FC&N's case, it was silently failing & not shutting down like this (hence why I was initially unaware of it until you brought it up here).

So, I'll get this squared away. =^/.^=