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

[tf2] Output canTransform msg only on state change #491

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tf2/src/buffer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ CompactFrameID BufferCore::validateFrameId(
return 0;
}

// Only check that a frame is non-existent once a frame was found
static bool init_state = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A static variable here is not correct. It will not correctly interact with potentially multiple BufferCore instances and doesn't deal with resetting the core.

CompactFrameID id = lookupFrameNumber(frame_id);
if (id == 0) {
if (id != 0) {
init_state = false;
}
if (!init_state && id == 0) {
fillOrWarnMessageForInvalidFrame(
function_name_arg, frame_id, error_msg, "frame does not exist");
}
Expand Down