It's been driving me insane, I'm using the same way of declaring tables in other modules, but I've never got such an error.
Here it is:
Here is where I get the error, at my prompt script (it's executed at the prompt):
The error I get is:
I think that somehow the function scan.salve () is not created, next (scan) returns nil
What am I doing wrong?
Here it is:
if
not scan
then
scan = {}
end --if
function scan.salve ()
if
GetVariable ("salve") == "1" and
able.to ("apply") and
not flags.get ("applying_salve")
then
--stuff, I don't think it's really relevant
end --if
end --function
return scan
Here is where I get the error, at my prompt script (it's executed at the prompt):
package.loaded.scan = nil
require "scan"
function prompt (sName, sLine, wildcards)
--other stuff
scan.salve ()
end --function
The error I get is:
Function/Sub: prompt called by trigger
Reason: processing trigger "Prompt"
[string "Script file"]:5618: attempt to call field 'salve' (a nil value)
I think that somehow the function scan.salve () is not created, next (scan) returns nil
What am I doing wrong?