scp-fs2open / scp-fs2open/fs2open.github.com

Add reset-event, the conclusion from discussing, Confusing behavior when a variable is passed to short-circuiting operators in a repeating event

Open
#4,184 9 comments 0 reactions 0 assignees View on GitHub
discussion enhancement sexps
Dominant language
C++
Stars
487
Forks
184
Avg merge
3d 8h
Merged PRs (30d)
45

Description

`has-docked-delay` and `has-undocked-delay`'s third parameter controls how many times the ships in question need to have (un)docked. When this parameter is satisfied with an SEXP variable (or, probably, with any non-constant SEXP), the expression short-circuits after returning `true`, leading to confusing behavior in repeating events.

Ideally, those operators wouldn't short-circuit when the third argument isn't a constant, but that would be a breaking change. Adding a parameter to decide whether it should short-circuit would be another possibility; however, since the behavior isn't particularly hard to work around, simply documenting it with a suggestion to use `every-time` might be sufficient.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.