From 9dbb68ea74d8c06f26d565a73620d4cbcba99f82 Mon Sep 17 00:00:00 2001 From: "p.kosyh" Date: Fri, 2 Jul 2010 05:08:16 +0000 Subject: [PATCH] visited fix for main, ini load arg added --- stead/goto.lua | 7 +++++++ stead/stead.lua | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stead/goto.lua b/stead/goto.lua index 25e4cb7..57732b3 100644 --- a/stead/goto.lua +++ b/stead/goto.lua @@ -99,6 +99,13 @@ go = function (self, where, back) return res; end +game.ini = stead.hook(game.ini,function(f, ...) + if isRoom(here()) then + here().__visited = 1 + end + return f(unpack(arg)) +end) + function visited(w) if not w then w = here() end w = ref(w) diff --git a/stead/stead.lua b/stead/stead.lua index a32b7e4..65c5320 100644 --- a/stead/stead.lua +++ b/stead/stead.lua @@ -1331,8 +1331,8 @@ function do_ini(self, load) local function call_codekey(k, o) stead.functions[o].key_name = k; end - local function call_ini(k, o) - v = stead.par('', v, call(o, 'ini')); + local function call_ini(k, o, ...) + v = stead.par('', v, call(o, 'ini'), unpack(arg)); end math.randomseed(tonumber(os.date("%m%d%H%M%S"))) @@ -1348,7 +1348,7 @@ function do_ini(self, load) call_key("game", game); for_each(game, "game", check_list, isList, deref(game)) end - for_each_object(call_ini); + for_each_object(call_ini, load); me():tag(); if not self.showlast then self._lastdisp = nil;