diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-02-26 22:06:10 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-02 18:12:07 +0100 |
commit | 34ac0d64e23f2b2d3981dbb0ea72157f334805dd (patch) | |
tree | 114b1f7a65956c097f7a59078292c9fa29c6451f /src/scripting/script.h | |
parent | e896d0b0125b48e12d43d99ace4498e56d968d50 (diff) | |
download | manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.gz manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.bz2 manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.xz manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.zip |
Merged all the different Lua states into one
No more Lua state for each status effect, monster, item effect or map. All
scripts are loaded into the same state. This should be more efficient overall
and make it easier to implement dynamic reloading of the scripts in the
future.
Now, this introduces the problem of name collisions between different Lua
scripts. For now this is solved by using more specific function names, like
'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however
to get rid of these globals, and register these callbacks from the script,
so that they can be local functions without the danger of colliding with
other scripts.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/scripting/script.h')
-rw-r--r-- | src/scripting/script.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/scripting/script.h b/src/scripting/script.h index a7737512..bd143114 100644 --- a/src/scripting/script.h +++ b/src/scripting/script.h @@ -135,21 +135,6 @@ class Script virtual void processRemoveEvent(Thing *thing) = 0; - /** - * Loads the global event script file - */ - static bool loadGlobalEventScript(const std::string &file); - - /** - * Runs a function from the global event script file - */ - static bool executeGlobalEventFunction(const std::string &function, Being *obj); - static void addDataToSpecial(int specialId, Special *special); - static bool performSpecialAction(int specialId, Being *caster); - static bool performCraft(Being *crafter, const std::list<InventoryItem> &recipe); - - static std::string determineEngineByFilename(const std::string &filename); - protected: std::string mScriptFile; @@ -157,8 +142,6 @@ class Script MapComposite *mMap; EventListener mEventListener; /**< Tracking of being deaths. */ - static Script *globalEventScript; - friend struct ScriptEventDispatch; }; |