diff --git a/features/force_control.lua b/features/force_control.lua index cf529167..07375187 100644 --- a/features/force_control.lua +++ b/features/force_control.lua @@ -212,7 +212,7 @@ end ---@return number the experience being removed ---@see ForceControl.remove_experience function ForceControl.remove_experience_percentage(lua_force_or_name, percentage, min_experience) - local min_experience = min_experience ~= nil and min_experience or 0 + min_experience = min_experience ~= nil and min_experience or 0 local force = get_valid_force(lua_force_or_name) if not force then return @@ -274,7 +274,7 @@ end ---@return number the experience being added ---@see ForceControl.add_experience function ForceControl.add_experience_percentage(lua_force_or_name, percentage, min_experience) - local min_experience = min_experience ~= nil and min_experience or 0 + min_experience = min_experience ~= nil and min_experience or 0 local force = get_valid_force(lua_force_or_name) if not force then return diff --git a/map_gen/Diggy/Feature/Experience.lua b/map_gen/Diggy/Feature/Experience.lua index 8fc7b19f..b63f9fe7 100644 --- a/map_gen/Diggy/Feature/Experience.lua +++ b/map_gen/Diggy/Feature/Experience.lua @@ -147,9 +147,9 @@ local function on_player_mined_entity(event) local level = ForceControl.get_force_data(force).current_level local exp if entity.name == 'sand-rock-big' then - exp = sand_rock_xp + (floor(level / 5)) + exp = sand_rock_xp + floor(level / 5) elseif entity.name == 'rock-huge' then - exp = rock_huge_xp + (floor(level / 5)) + exp = rock_huge_xp + floor(level / 5) else return end @@ -200,7 +200,7 @@ end ---@param event LuaEvent local function on_rocket_launched(event) local force = event.rocket.force - local exp = ForceControl.add_experience_percentage(force, config.XP['rocket_launch'], 5000) + local exp = ForceControl.add_experience_percentage(force, config.XP['rocket_launch']) local text = string_format('Rocket launched! +%d XP', exp) for _, p in pairs(game.connected_players) do local player_index = p.index @@ -222,9 +222,9 @@ local function on_entity_died (event) if force and force.name == 'player' then local level = ForceControl.get_force_data(force).current_level if entity.name == 'sand-rock-big' then - exp = floor((sand_rock_xp + (floor(level / 5))) / 2) + exp = floor((sand_rock_xp + (level / 5)) / 2) elseif entity.name == 'rock-huge' then - exp = floor((rock_huge_xp + (floor(level / 5))) / 2) + exp = floor((rock_huge_xp + (level / 5)) / 2) else return end