Skip to content

fix: remove global toFixed calls that interfere with TFAR radios#58

Merged
fank merged 1 commit intomainfrom
fix/remove-global-toFixed
Feb 15, 2026
Merged

fix: remove global toFixed calls that interfere with TFAR radios#58
fank merged 1 commit intomainfrom
fix/remove-global-toFixed

Conversation

@fank
Copy link
Member

@fank fank commented Feb 15, 2026

Summary

  • Removes standalone toFixed 2 / toFixed -1 calls from the vehicle capture loop in fnc_captureLoop.sqf
  • These calls modify engine-wide number formatting state, which corrupts TFAR radio frequency strings (needs 3+ decimal places, gets truncated to 2) during the window between set and reset
  • This ran every capture tick for every vehicle, creating constant windows where TFAR operations would get corrupted, making radios unusable

Test plan

  • Verify OCAP recording still captures vehicle data correctly (positions, turret angles)
  • Verify TFAR radios remain functional throughout a mission with OCAP active
  • Confirm no regressions in extension data format

The standalone `toFixed 2` / `toFixed -1` calls in the capture loop
modify engine-wide number formatting state. This corrupts TFAR radio
frequency strings (which need 3+ decimal places) during the window
between set and reset, making radios unusable.
@gemini-code-assist
Copy link

Summary of Changes

Hello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical compatibility issue where global number formatting changes, inadvertently introduced by OCAP's vehicle capture loop, were interfering with TFAR radio functionality. By removing specific toFixed calls that modified engine-wide formatting state, the PR prevents the truncation of TFAR radio frequencies, thereby restoring radio usability without impacting OCAP's data recording capabilities.

Highlights

  • Global toFixed calls removed: Eliminated toFixed 2 and toFixed -1 calls from fnc_captureLoop.sqf that were globally altering number formatting, which caused unintended side effects.
  • TFAR radio compatibility fixed: Resolved an issue where global toFixed calls corrupted TFAR radio frequency strings by truncating decimal places, making radios unusable during OCAP capture.
  • OCAP recording integrity maintained: Ensured that vehicle data capture for OCAP recording remains correct and unaffected by these changes, preserving its core functionality.
Changelog
  • addons/recorder/fnc_captureLoop.sqf
    • Removed toFixed 2 calls from the vehicle data capture logic.
    • Removed toFixed -1 calls from the vehicle data capture logic.
    • Eliminated toFixed 2 and toFixed -1 calls within the null object handling block.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a critical issue by removing global toFixed calls from the per-frame capture loop. These calls were modifying engine-wide number formatting, causing conflicts with other systems like TFAR. The removal of toFixed is the correct approach to prevent such global state corruption. The change will result in vehicle data being sent with full floating-point precision, and the test plan rightly includes verification of the data handling on the receiving end. The fix is clean, targeted, and effectively resolves the reported problem.

@fank fank merged commit c7d6f20 into main Feb 15, 2026
1 check passed
@fank fank deleted the fix/remove-global-toFixed branch February 15, 2026 23:35
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

Successfully merging this pull request may close these issues.

1 participant