Rampant, fixed


Based on Rampant 1.1.1 (new AI and enemies). - New types of enemies - Works on SA planets, can control biters, demolishers, Gleba units - Can mutate existing nests - Can attack from afar - Improved search for a passage in the defense - Some new mechanics

Content
a month ago
1.1 - 2.0
60.4K
Enemies

b non-recoverable error

a day ago
(updated a day ago)

Hi really enjoying the mod thank you so much for updating it, we ran into an issue during a warptorio playthrough with rampart fixed

6934.610 Error MainLoop.cpp:1468: Exception at tick 6118440: The mod Rampant, fixed (2.2.6) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event RampantFixed::on_tick (ID 0)
invalid key to 'next'
stack traceback:
[C]: in function 'next'
RampantFixed/libs/BaseUtils.lua:541: in function 'recycleBases'
RampantFixed/control.lua:1470: in function <RampantFixed/control.lua:1425>
6934.610 Error ServerMultiplayerManager.cpp:84: MultiplayerManager failed: "The mod Rampant, fixed (2.2.6) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event RampantFixed::on_tick (ID 0)
invalid key to 'next'
stack traceback:
[C]: in function 'next'
RampantFixed/libs/BaseUtils.lua:541: in function 'recycleBases'
RampantFixed/control.lua:1470: in function <RampantFixed/control.lua:1425>"
6934.610 Info ServerMultiplayerManager.cpp:808: updateTick(6118440) changing state from(InGame) to(Failed)
6934.624 Quitting: multiplayer error.

We found a quick solution

Before:

        local chunk = next(base.chunks, nil)
        if not chunk then
            --game.print("recycled base [gps=" .. base.x .. "," .. base.y .."]".. serpent.dump(base.chunks))    -- debug
            universe.growingBases[id] = nil
            if universe.growingBasesIterator == id then
                universe.growingBasesIterator = nil
            end
            map.basesToGrow[id] = nil
            bases[id] = nil
        end
    end 
    universe.recycleBaseIterator = next(bases, id)

After:

        local nextId = next(bases, id)
        local chunk = next(base.chunks, nil)
        if not chunk then
            --game.print("recycled base [gps=" .. base.x .. "," .. base.y .."]".. serpent.dump(base.chunks))    -- debug
            universe.growingBases[id] = nil
            if universe.growingBasesIterator == id then
                universe.growingBasesIterator = nil
            end
            map.basesToGrow[id] = nil
            bases[id] = nil
        end
        universe.recycleBaseIterator = nextId
    end

In libs/BaseUtils.lua:530

The code was calling next(bases, id) after potentially deleting bases[id], which causes a runtime error because next() was being called with a key that no longer exists in the table.

a day ago
(updated a day ago)

It seems there are more than one error...
Fortunately, surfaces and chunks don't get removed often.
So, players shouldn't encounter this bug in the regular game.
I'll fix it in the next release, thank you

New response