Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 229
    • Issues 229
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus Games
  • solarussolarus
  • Issues
  • #371
Closed
Open
Created Dec 03, 2013 by Christopho@christophoOwner

Crash without message when calling enemy:restart() from on_removed

Created by: Renkineko

Here you have an example script of a generator of enemies. It will pop a tentacle, and when you kill it, the enemy restart. If, when you have the tentacle summoned, you quit the map or if you reload the game via quick debug key (F1 to F3 on ZSDX), the game crash without message nor alert.

Engine version : 1.2

function enemy:on_restarted()
    print('Wait a little...')
    -- if you want to test after you killed the tentacle...
    sol.timer.start(enemy, 2500, function()
        local tentacle = enemy:create_enemy({breed = 'tentacle', x = -20, y = -20})
        print('You can now load the game with F[1-3] key or quit the map to crash')
        function tentacle:on_removed()
            print('If you reload the game or quit the map now, you will not have a crash...')
            enemy:restart()
        end
    end)
end
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking