Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function register_persitent_tag(name, reader, writer)
- old_on_load = wesnoth.game_events.on_load
- old_on_save = wesnoth.game_events.on_save
- function wesnoth.game_events.on_load(cfg)
- for i = 1, #cfg
- if cfg[i][1] == name then
- reader(cfg[i][2])
- end
- end
- old_on_load(cfg)
- end
- function wesnoth.game_events.on_save(cfg)
- local res = old_on_save()
- table.insert(res, { name, writer()})
- return res
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement