Merge pull request #2495 from wolfboyft/lua-api-docs-patch

Add math.floor to module example in Lua API
develop
Myk 2022-12-11 15:55:05 -08:00 committed by GitHub
commit c08319004a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

@ -3583,7 +3583,9 @@ Examples:
-- check projectile distance flown is zero, get firer, etc...
local multiplier = tonumber(customRawTokens.getToken(bow, "EXAMPLE_MOD_FIRE_RATE_MULTIPLIER")) or 1
firer.counters.think_counter = firer.counters.think_counter * multiplier
if firer.counters.think_counter > 0 then
firer.counters.think_counter = math.max(math.floor(firer.counters.think_counter * multiplier), 1)
end
* Something for a script that prints help text about different types of units::