Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some Lua terminal functionality broken for M1 maps #467

Open
treellama opened this issue Jan 28, 2024 · 1 comment
Open

some Lua terminal functionality broken for M1 maps #467

treellama opened this issue Jan 28, 2024 · 1 comment

Comments

@treellama
Copy link
Member

M1 maps do not have M2 terminals, so number_of_terminal_texts() always returns 0. Unfortunately, this is used for Lua_Terminal::Valid, so:

  • # Terminals and Terminals[id] do not work
  • Triggers.enter_terminal() and Triggers.exit_terminal() return nil for the first argument

Player::activate_terminal does still work, if you pass a number.

@Hopper262
Copy link
Member

The stock M1 map always uses terminal permutation values in the range 0..9, although Aleph One does not enforce this. It might be good enough to have #Terminals always return 10 for M1 maps, and use the presence of the corresponding resource to determine validity. This would be similar to other lists with gaps such as Projectiles or Scenery. The behavior of Terminals() would be comparable to M2, iterating used and unused terminals intended for the current level.

Triggers could still return nil if a terminal outside the conventional range were activated, but the common cases would work. It also avoids dealing with negative terminal IDs, which would happen if we considered all terminals in a scenario to be valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants