mirror of
https://github.com/minetest-mods/player_monoids.git
synced 2025-01-09 00:50:19 +01:00
Fix readme nested monoids example
This commit is contained in:
parent
d76cde2dc1
commit
ef6f07b6fa
@ -104,12 +104,12 @@ the strongest boost. Most of it could be done the same way:
|
||||
-- My speed boosts monoid takes speed multipliers (numbers) that are at least 1.
|
||||
newmod.speed_boosts = player_monoids.make_monoid({
|
||||
combine = function(speed1, speed2)
|
||||
return speed1 * speed2
|
||||
return math.max(speed1, speed2)
|
||||
end,
|
||||
fold = function(tab)
|
||||
local res = 1
|
||||
for _, speed in pairs(tab) do
|
||||
res = res * speed
|
||||
res = math.max(res, speed)
|
||||
end
|
||||
end,
|
||||
identity = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user