aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
Commit message (Expand)AuthorAge
...
* Remove os.exit from the Lua secure sandbox (#5090)Loïc Blot2017-01-21
* Added lua tracebacks to some errors where you have been blind to what… (#5043)sapier2017-01-15
* Make minetest abort on lua panicRogier2016-12-24
* Security: Fix resolving of some relative pathsShadowNinja2016-12-20
* Mod security: Allow read-only access to all mod pathsShadowNinja2016-12-20
* Fix secure io.linesShadowNinja2016-11-24
* Fix secure io.open without modeShadowNinja2016-11-24
* Fix memory leak in ::safeLoadFile (#4730)Zeno-2016-11-05
* Emergeblocks: Fix occasional crashRogier2016-10-16
* use unordered containers where possible (patch 4 on X)Loic Blot2016-10-06
* Make plantlike drawtype more funAuke Kok2016-08-26
* couple of memory leaks fixes.David Carlier2016-08-10
* Server: Add reason for leave to `on_leaveplayer` callbacksDiego Martinez2016-06-11
* Remove unused code in s_security.cpp (#4172)Zeno-2016-05-30
* Nodebox: Allow nodeboxes to "connect"Auke Kok2016-03-12
* s_env.{cpp, h} cleanupsest312016-03-07
* Add minetest.register_lbm() to run code on block load onlyest312016-03-07
* Use LuaErrors in security check macrosShadowNinja2016-03-07
* Remove debug.getupvalue from the Lua sandbox whitelistShadowNinja2016-03-03
* Fix C++11 compilabilityest312016-01-23
* Add on_secondary_use when right clicking an item in the airAlex Ford2015-12-02
* Add callback parameter for core.emerge_area()kwolekr2015-11-02
* Fix Lua scripting synchronizationkwolekr2015-11-01
* Fix server crashing on Lua errorsShadowNinja2015-10-31
* Remove some abort() callsest312015-10-26
* ABMs: Make catch-up behaviour optionalparamat2015-10-18
* Add new ContentParamType2 "CPT2_DEGROTATE"est312015-10-04
* Push error handler afresh each time lua_pcall is usedKahrl2015-08-27
* Use numeric indices and raw table access with LUA_REGISTRYINDEXKahrl2015-08-27
* Clean up threadingShadowNinja2015-08-23
* SAPI: Track last executed mod and include in error messageskwolekr2015-08-12
* Display Lua memory usage at the time of Out-of-Memory errorkwolekr2015-08-10
* Improve Script CPP API diagnosticskwolekr2015-08-05
* Optional reconnect functionalityest312015-07-23
* Fix code style from recent commits and add misc. optimizationskwolekr2015-07-02
* Add Lua errors to error dialogrubenwardy2015-06-29
* Add minetest.register_on_player_hpchangeTeTpaAka2015-06-13
* dofile error reporting for syntax errorsest312015-06-12
* Fix uninitialized variable errorest312015-06-02
* Fix Windows build, clean up included headersSmallJoker2015-05-22
* Replace instances of std::map<std::string, std::string> with StringMapkwolekr2015-05-19
* Add mod securityShadowNinja2015-05-16
* Add minetest.register_on_punchplayerBrandon2015-05-15
* Clean up and tweak build systemShadowNinja2015-03-27
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Performance fixes.onkrot2015-01-13
* Expose mapgen parameters on scripting initkwolekr2014-12-29
* Expose mapgen chunksize in on_mapgen_init callbackskwolekr2014-12-14
* Simplify loading of Android version of menuShadowNinja2014-11-20
* Add meshnode drawtype.RealBadAngel2014-10-18
llisionbox = {-0.3,-0.3,-0.3, 0.3,0.3,0.3}, visual_size = {x=0.7, y=0.7}, initial_sprite_basepos = {x=0, y=0}, is_couple=true, static_save = false, on_activate=function(self, staticdata) return advtrains.pcall(function() if staticdata=="COUPLE" then --couple entities have no right to exist further... atprint("Couple loaded from staticdata, destroying") self.object:remove() return end self.object:set_armor_groups({immmortal=1}) end) end, get_staticdata=function(self) return "COUPLE" end, on_rightclick=function(self, clicker) return advtrains.pcall(function() if not self.train_id_1 or not self.train_id_2 then return end local pname=clicker if type(clicker)~="string" then pname=clicker:get_player_name() end if advtrains.safe_couple_trains(self.train_id_1, self.train_id_2, self.t1_is_front, self.t2_is_front, pname) then self.object:remove() else lockmarker(self.object) end end) end, on_step=function(self, dtime) return advtrains.pcall(function() advtrains.atprint_context_tid=self.train_id_1 if not self.train_id_1 or not self.train_id_2 then atprint("Couple: train ids not set!") self.object:remove() return end local train1=advtrains.trains[self.train_id_1] local train2=advtrains.trains[self.train_id_2] if not train1 or not train2 then atprint("Couple: trains missing, destroying") self.object:remove() return end --shh, silence here, this is an on-step callback! if not advtrains.train_ensure_init(self.train_id_1, train1) then --atwarn("Train",self.train_id_1,"is not initialized! Operation aborted!") return end if not advtrains.train_ensure_init(self.train_id_2, train2) then --atwarn("Train",self.train_id_2,"is not initialized! Operation aborted!") return end if train1.velocity>0 or train2.velocity>0 then if not self.position_set then --ensures that train stands a single time before check fires. Using flag below return end atprint("Couple: train is moving, destroying") self.object:remove() return end if not self.position_set then local tp1 if self.t1_is_front then tp1=advtrains.path_get_interpolated(train1, train1.index) else tp1=advtrains.path_get_interpolated(train1, train1.end_index) end local tp2 if self.t2_is_front then tp2=advtrains.path_get_interpolated(train2, train2.index) else tp2=advtrains.path_get_interpolated(train2, train2.end_index) end local pos_median=advtrains.pos_median(tp1, tp2) if not vector.equals(pos_median, self.object:getpos()) then self.object:setpos(pos_median) end self.position_set=true end atprintbm("couple step", t) advtrains.atprint_context_tid=nil end) end, }) minetest.register_entity("advtrains:lockmarker", { visual="sprite", textures = {"advtrains_cpl_lock.png"}, collisionbox = {-0.3,-0.3,-0.3, 0.3,0.3,0.3}, visual_size = {x=0.7, y=0.7}, initial_sprite_basepos = {x=0, y=0}, is_lockmarker=true, static_save = false, on_activate=function(self, staticdata) return advtrains.pcall(function() if staticdata=="COUPLE" then --couple entities have no right to exist further... atprint("Couple loaded from staticdata, destroying") self.object:remove() return end self.object:set_armor_groups({immmortal=1}) self.life=5 end) end, get_staticdata=function(self) return "COUPLE" end, on_step=function(self, dtime) self.life=(self.life or 5)-dtime if self.life<0 then self.object:remove() end end, })