aboutsummaryrefslogtreecommitdiff
path: root/src/mods.h
Commit message (Expand)AuthorAge
* Fix server crashing on Lua errorsShadowNinja2015-10-31
* Remove ugly curl struct pointer from jsonFetchValue signaturesapier2014-06-19
* Pass arguments by referenceSelat2014-03-12
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Add support for modstore screenshotssapier2013-07-22
* Replace C++ mainmenu by formspec powered onesapier2013-07-02
* Optional dependencies and properly handle mod name conflicts againKahrl2013-05-03
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Improve behaviour for empty modpacks and when no mods at all are installed:Jürgen Doser2013-01-22
* Basic support for configuring which mods to load for each worldJürgen Doser2013-01-21
* Optimize headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Add minetest.get_modpath(modname)Perttu Ahola2011-12-11
* Better mod loading error handlingPerttu Ahola2011-12-03
registerObject(T *obj) = 0; virtual void removeObject(u16 id) = 0; T *getActiveObject(u16 id) { typename std::unordered_map<u16, T *>::const_iterator n = m_active_objects.find(id); return (n != m_active_objects.end() ? n->second : nullptr); } protected: u16 getFreeId() const { // try to reuse id's as late as possible static thread_local u16 last_used_id = 0; u16 startid = last_used_id; while (!isFreeId(++last_used_id)) { if (last_used_id == startid) return 0; } return last_used_id; } bool isFreeId(u16 id) const { return id != 0 && m_active_objects.find(id) == m_active_objects.end(); } std::unordered_map<u16, T *> m_active_objects; };