diff options
author | Aki <nthirtyone@gmail.com> | 2016-06-07 22:10:29 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-06-07 22:10:29 +0200 |
commit | 33b5a2969a0de51f4241f170cafb386efa31cc99 (patch) | |
tree | 925c904ff4b1a10cf0ee7bdc2bac439adbc1995f /world.lua | |
parent | 5d9addae1483c5ccfd75b39b50fb950315f9c55e (diff) | |
download | roflnauts-33b5a2969a0de51f4241f170cafb386efa31cc99.zip roflnauts-33b5a2969a0de51f4241f170cafb386efa31cc99.tar.gz roflnauts-33b5a2969a0de51f4241f170cafb386efa31cc99.tar.bz2 |
Dest
Destructors to make memory managment a little bit more efficient in long
terms.
Diffstat (limited to 'world.lua')
-rw-r--r-- | world.lua | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -65,6 +65,18 @@ function World:new(map, ...) return o end +-- The end of the world +function World:delete() + self.world:destroy() + for _,platform in pairs(self.Platforms) do + platform:delete() + end + for _,naut in pairs(self.Nauts) do + naut:delete() + end + self = nil +end + -- Load map from file function World:loadMap(name) local name = name or "default" |