Only manual users of the script felt the first run code changes (disable particles and flinching animations) because the TM / GM runs the instant the page is loaded, not when the game is loaded.
The script got past the original checks like normal in TM / GM because it checked to see if m_bRunning and m_rgPlayerTechTree existed first (those indicate the game has fully loaded). However, the first run code was run before the interval started, thus making it useless to TM / GM users. This pull request fixes that by putting all of that code into a firstRun function and only running it once after it goes through the initial check.
The TODO statements were placed at the top for readability, and I updated their bullets to match the README.md's version.
Due to the first run changes, I moved the interval checking to the bottom. This also removes the need to run the check every single time the interval goes through a cycle.
Only manual users of the script felt the first run code changes (disable particles and flinching animations) because the TM / GM runs the instant the page is loaded, not when the game is loaded.
The script got past the original checks like normal in TM / GM because it checked to see if
m_bRunning
andm_rgPlayerTechTree
existed first (those indicate the game has fully loaded). However, the first run code was run before the interval started, thus making it useless to TM / GM users. This pull request fixes that by putting all of that code into afirstRun
function and only running it once after it goes through the initial check.The TODO statements were placed at the top for readability, and I updated their bullets to match the README.md's version.
Due to the first run changes, I moved the interval checking to the bottom. This also removes the need to run the check every single time the interval goes through a cycle.