aboutsummaryrefslogtreecommitdiff
path: root/src
ModeNameSize
-rw-r--r--CMakeLists.txt21070logplain
-rw-r--r--activeobject.h1584logplain
-rw-r--r--ban.cpp3710logplain
-rw-r--r--ban.h1505logplain
-rw-r--r--base64.cpp3692logplain
-rw-r--r--base64.h250logplain
-rw-r--r--camera.cpp22376logplain
-rw-r--r--camera.h5669logplain
-rw-r--r--cavegen.cpp16186logplain
-rw-r--r--cavegen.h2786logplain
d---------cguittfont248logplain
-rw-r--r--chat.cpp17259logplain
-rw-r--r--chat.h7255logplain
-rw-r--r--client.cpp73546logplain
-rw-r--r--client.h13305logplain
-rw-r--r--clientiface.cpp19224logplain
-rw-r--r--clientiface.h15802logplain
-rw-r--r--clientmap.cpp25318logplain
-rw-r--r--clientmap.h3727logplain
-rw-r--r--clientmedia.cpp19639logplain
-rw-r--r--clientmedia.h4457logplain
-rw-r--r--clientobject.cpp1773logplain
-rw-r--r--clientobject.h3901logplain
-rw-r--r--clientserver.h15279logplain
-rw-r--r--clientsimpleobject.h1113logplain
-rw-r--r--clouds.cpp9714logplain
-rw-r--r--clouds.h1963logplain
-rw-r--r--cmake_config.h.in1219logplain
-rw-r--r--cmake_config_githash.h.in233logplain
-rw-r--r--collision.cpp17508logplain
-rw-r--r--collision.h2763logplain
-rw-r--r--config.h1903logplain
-rw-r--r--connection.cpp82593logplain
-rw-r--r--connection.h25161logplain
-rw-r--r--constants.h3115logplain
-rw-r--r--content_abm.cpp1200logplain
-rw-r--r--content_abm.h1006logplain
-rw-r--r--content_cao.cpp48229logplain
-rw-r--r--content_cao.h4433logplain
-rw-r--r--content_cso.cpp2893logplain
-rw-r--r--content_cso.h1032logplain
-rw-r--r--content_mapblock.cpp53561logplain
-rw-r--r--content_mapblock.h992logplain
-rw-r--r--content_mapnode.cpp8109logplain
-rw-r--r--content_mapnode.h1510logplain
-rw-r--r--content_nodemeta.cpp5541logplain
-rw-r--r--content_nodemeta.h1196logplain
-rw-r--r--content_object.h1263logplain
-rw-r--r--content_sao.cpp39185logplain
-rw-r--r--content_sao.h8296logplain
-rw-r--r--convert_json.cpp9660logplain
-rw-r--r--convert_json.h1215logplain
-rw-r--r--craftdef.cpp27130logplain
-rw-r--r--craftdef.h11691logplain
-rw-r--r--database-dummy.cpp1848logplain
-rw-r--r--database-dummy.h1380logplain
-rw-r--r--database-leveldb.cpp2646logplain
-rw-r--r--database-leveldb.h1424logplain
-rw-r--r--database-redis.cpp4205logplain
-rw-r--r--database-redis.h1422logplain
-rw-r--r--database-sqlite3.cpp8844logplain
-rw-r--r--database-sqlite3.h1736logplain
-rw-r--r--database.cpp1751logplain
-rw-r--r--database.h1412logplain
-rw-r--r--daynightratio.h1841logplain
-rw-r--r--debug.cpp7173logplain
-rw-r--r--debug.h4218logplain
-rw-r--r--defaultsettings.cpp15047logplain
-rw-r--r--defaultsettings.h1237logplain
-rw-r--r--drawscene.cpp18939logplain
-rw-r--r--drawscene.h1366logplain
-rw-r--r--dungeongen.cpp17026logplain
-rw-r--r--dungeongen.h2722logplain
-rw-r--r--emerge.cpp15805logplain
-rw-r--r--emerge.h3161logplain
-rw-r--r--environment.cpp69524logplain
-rw-r--r--environment.h13652logplain
-rw-r--r--event.h1912logplain
-rw-r--r--event_manager.h2964logplain
-rw-r--r--exceptions.h4099logplain
-rw-r--r--filecache.cpp2258logplain
-rw-r--r--filecache.h1358logplain
-rw-r--r--filesys.cpp16193logplain
-rw-r--r--filesys.h3272logplain
-rw-r--r--fontengine.cpp12878logplain
-rw-r--r--fontengine.h3694logplain
-rw-r--r--game.cpp119035logplain
-rw-r--r--game.h3149logplain
-rw-r--r--gamedef.h2881logplain
-rw-r--r--genericobject.cpp4538logplain
-rw-r--r--genericobject.h2405logplain
-rw-r--r--gettext.cpp7766logplain
-rw-r--r--gettext.h2638logplain
-rw-r--r--gettime.h1572logplain
-rw-r--r--guiChatConsole.cpp14232logplain
-rw-r--r--guiChatConsole.h3571logplain
-rw-r--r--guiEngine.cpp17088logplain
-rw-r--r--guiEngine.h8789logplain
-rw-r--r--guiFileSelectMenu.cpp3240logplain
-rw-r--r--guiFileSelectMenu.h1757logplain
-rw-r--r--guiFormSpecMenu.cpp100966logplain
-rw-r--r--guiFormSpecMenu.h10694logplain
-rw-r--r--guiKeyChangeMenu.cpp11738logplain
-rw-r--r--guiKeyChangeMenu.h1946logplain
-rw-r--r--guiMainMenu.h1489logplain
-rw-r--r--guiPasswordChange.cpp6223logplain
-rw-r--r--guiPasswordChange.h1459logplain
-rw-r--r--guiTable.cpp34279logplain
-rw-r--r--guiTable.h7223logplain
-rw-r--r--guiVolumeChange.cpp4578logplain
-rw-r--r--guiVolumeChange.h1504logplain
-rw-r--r--hex.h1689logplain
-rw-r--r--httpfetch.cpp20152logplain
-rw-r--r--httpfetch.h3731logplain
-rw-r--r--hud.cpp18792logplain
-rw-r--r--hud.h3727logplain
-rw-r--r--inventory.cpp20052logplain
-rw-r--r--inventory.h8194logplain
-rw-r--r--inventorymanager.cpp20949logplain
-rw-r--r--inventorymanager.h5068logplain
-rw-r--r--irr_aabb3d.h939logplain
-rw-r--r--irr_v2d.h1070logplain
-rw-r--r--irr_v3d.h996logplain
-rw-r--r--irrlichttypes.h1598logplain
-rw-r--r--irrlichttypes_bloated.h989logplain
-rw-r--r--irrlichttypes_extrabloated.h1187logplain
-rw-r--r--itemdef.cpp17924logplain
-rw-r--r--itemdef.h4664logplain
-rw-r--r--itemgroup.h1143logplain
d---------json151logplain
d---------jthread340logplain
-rw-r--r--keycode.cpp11773logplain
-rw-r--r--keycode.h1833logplain
-rw-r--r--light.cpp3873logplain
-rw-r--r--light.h2988logplain
-rw-r--r--localplayer.cpp15941logplain
-rw-r--r--localplayer.h2491logplain
-rw-r--r--log.cpp4405logplain
-rw-r--r--log.h2609logplain
-rw-r--r--logoutputbuffer.h1351logplain
d---------lua109logplain
-rw-r--r--luaentity_common.h1050logplain
-rw-r--r--main.cpp59029logplain
-rw-r--r--main.h1698logplain
-rw-r--r--mainmenumanager.h3763logplain
-rw-r--r--map.cpp89321logplain
-rw-r--r--map.h14314logplain
-rw-r--r--mapblock.cpp26235logplain
-rw-r--r--mapblock.h13583logplain
-rw-r--r--mapblock_mesh.cpp38252logplain
-rw-r--r--mapblock_mesh.h5674logplain
-rw-r--r--mapchunk.h1831logplain
-rw-r--r--mapgen.cpp11241logplain
-rw-r--r--mapgen.h4778logplain
-rw-r--r--mapgen_singlenode.cpp3135logplain
-rw-r--r--mapgen_singlenode.h1640logplain
-rw-r--r--mapgen_v5.cpp16453logplain
-rw-r--r--mapgen_v5.h2732logplain
-rw-r--r--mapgen_v6.cpp29632logplain
-rw-r--r--mapgen_v6.h4031logplain
-rw-r--r--mapgen_v7.cpp22987logplain
-rw-r--r--mapgen_v7.h3211logplain
-rw-r--r--mapnode.cpp16564logplain
-rw-r--r--mapnode.h7744logplain
-rw-r--r--mapsector.cpp4870logplain
-rw-r--r--mapsector.h2753logplain
-rw-r--r--mesh.cpp25576logplain
-rw-r--r--mesh.h2780logplain
-rw-r--r--mg_biome.cpp4150logplain
-rw-r--r--mg_biome.h1913logplain
-rw-r--r--mg_decoration.cpp8534logplain
-rw-r--r--mg_decoration.h3390logplain
-rw-r--r--mg_ore.cpp7730logplain
-rw-r--r--mg_ore.h3672logplain
-rw-r--r--mg_schematic.cpp10349logplain
-rw-r--r--mg_schematic.h2569logplain
-rw-r--r--modalMenu.h3787logplain
-rw-r--r--modifiedstate.h1171logplain
-rw-r--r--mods.cpp10758logplain
-rw-r--r--mods.h5446logplain
-rw-r--r--nameidmapping.cpp1553logplain
-rw-r--r--nameidmapping.h2137logplain
-rw-r--r--nodedef.cpp39053logplain
-rw-r--r--nodedef.h11284logplain
-rw-r--r--nodemetadata.cpp4782logplain
-rw-r--r--nodemetadata.h2446logplain
-rw-r--r--nodetimer.cpp3665logplain
-rw-r--r--nodetimer.h2216logplain
-rw-r--r--noise.cpp18430logplain
-rw-r--r--noise.h6206logplain
-rw-r--r--object_properties.cpp4565logplain
-rw-r--r--object_properties.h1587logplain
-rw-r--r--particles.cpp10974logplain
-rw-r--r--particles.h3786logplain
-rw-r--r--pathfinder.cpp28914logplain
-rw-r--r--pathfinder.h10102logplain
-rw-r--r--player.cpp8672logplain
-rw-r--r--player.h6378logplain
-rw-r--r--porting.cpp12921logplain
-rw-r--r--porting.h10069logplain
-rw-r--r--porting_android.cpp8522logplain
-rw-r--r--porting_android.h2181logplain
-rw-r--r--profiler.h5132logplain
-rw-r--r--quicktune.cpp2618logplain
-rw-r--r--quicktune.h2837logplain
-rw-r--r--quicktune_shortcutter.h2200logplain
-rw-r--r--rollback.cpp26742logplain
-rw-r--r--rollback.h3545logplain
-rw-r--r--rollback_interface.cpp7218logplain
-rw-r--r--rollback_interface.h4108logplain
d---------script331logplain
-rw-r--r--serialization.cpp6110logplain
-rw-r--r--serialization.h3214logplain
-rw-r--r--server.cpp132237logplain
-rw-r--r--server.h17430logplain
-rw-r--r--serverlist.cpp7406logplain
-rw-r--r--serverlist.h1853logplain
-rw-r--r--serverobject.cpp2521logplain
-rw-r--r--serverobject.h7007logplain
-rw-r--r--settings.cpp20514logplain
-rw-r--r--settings.h7459logplain
-rw-r--r--sha1.cpp5680logplain
-rw-r--r--sha1.h1623logplain
-rw-r--r--shader.cpp24639logplain
-rw-r--r--shader.h3084logplain
-rw-r--r--sky.cpp24486logplain
-rw-r--r--sky.h4144logplain
-rw-r--r--socket.cpp13976logplain
-rw-r--r--socket.h3295logplain
-rw-r--r--sound.cpp882logplain
-rw-r--r--sound.h3234logplain
-rw-r--r--sound_openal.cpp14383logplain
-rw-r--r--sound_openal.h943logplain
d---------sqlite116logplain
-rw-r--r--staticobject.cpp1909logplain
-rw-r--r--staticobject.h2261logplain
-rw-r--r--strfnd.h4413logplain
-rw-r--r--subgame.cpp8391logplain
-rw-r--r--subgame.h2791logplain
-rw-r--r--test.cpp62982logplain
-rw-r--r--test.h853logplain
-rw-r--r--threads.h1141logplain
-rw-r--r--tile.cpp53376logplain
-rw-r--r--tile.h7335logplain
-rw-r--r--tool.cpp6206logplain
-rw-r--r--tool.h3166logplain
-rw-r--r--touchscreengui.cpp20791logplain
-rw-r--r--touchscreengui.h4112logplain
-rw-r--r--treegen.cpp19912logplain
-rw-r--r--treegen.h2822logplain
d---------util685logplain
-rw-r--r--version.cpp1431logplain
-rw-r--r--version.h967logplain
-rw-r--r--voxel.cpp17447logplain
-rw-r--r--voxel.h12561logplain
-rw-r--r--voxelalgorithms.cpp4683logplain
-rw-r--r--voxelalgorithms.h1678logplain
-rw-r--r--wieldmesh.cpp14018logplain
-rw-r--r--wieldmesh.h2314logplain
lass="hl kwa">end end end train.max_speed=math.min(train.max_speed, wagon.max_speed) train.extent_h = math.max(train.extent_h, wagon.extent_h or 1); end end end -- This function checks whether entities need to be spawned for certain wagons, and spawns them. function advtrains.spawn_wagons(train_id) local train=advtrains.trains[train_id] for i, w_id in ipairs(train.trainparts) do local data = advtrains.wagons[w_id] if data then if not data.object or not data.object:getyaw() then -- eventually need to spawn new object. check if position is loaded. local index = advtrains.path_get_index_by_offset(train, train.index, -data.pos_in_train) local pos = advtrains.path_get(train, atfloor(index)) if minetest.get_node_or_nil(pos) then local wt = data.type if not minetest.registered_luaentities[wt] then atprint("Unable to load",w_id,"of type",wt,", using placeholder") wt="advtrains:wagon_placeholder" end wagon=minetest.add_entity(pos, wt):get_luaentity() wagon:set_id(w_id) end end end end end function advtrains.split_train_at_wagon(wagon) --get train local train=advtrains.trains[wagon.train_id] if not train.path then return end local real_pos_in_train=advtrains.get_real_path_index(train, wagon.pos_in_train) local pos_for_new_train=train.path[math.floor(real_pos_in_train+wagon.wagon_span)] local pos_for_new_train_prev=train.path[math.floor(real_pos_in_train+wagon.wagon_span-1)] --before doing anything, check if both are rails. else do not allow if not pos_for_new_train then atprint("split_train: pos_for_new_train not set") return false end local node_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) if not node_ok then atprint("split_train: pos_for_new_train ",advtrains.round_vector_floor_y(pos_for_new_train_prev)," not loaded or is not a rail") return false end if not train.last_pos_prev then atprint("split_train: pos_for_new_train_prev not set") return false end local prevnode_ok=advtrains.get_rail_info_at(advtrains.round_vector_floor_y(pos_for_new_train), train.drives_on) if not prevnode_ok then atprint("split_train: pos_for_new_train_prev ", advtrains.round_vector_floor_y(pos_for_new_train_prev), " not loaded or is not a rail") return false end --create subtrain local newtrain_id=advtrains.create_new_train_at(pos_for_new_train, pos_for_new_train_prev) local newtrain=advtrains.trains[newtrain_id] --insert all wagons to new train for k,v in ipairs(train.trainparts) do if k>=wagon.pos_in_trainparts then table.insert(newtrain.trainparts, v) train.trainparts[k]=nil end end --update train parts advtrains.update_trainpart_properties(wagon.train_id)--atm it still is the desierd id. advtrains.update_trainpart_properties(newtrain_id) train.tarvelocity=0 newtrain.velocity=train.velocity newtrain.tarvelocity=0 newtrain.enter_node_all=true newtrain.couple_lck_back=train.couple_lck_back newtrain.couple_lck_front=false train.couple_lck_back=false end --there are 4 cases: --1/2. F<->R F<->R regular, put second train behind first --->frontpos of first train will match backpos of second --3. F<->R R<->F flip one of these trains, take the other as new train --->backpos's will match --4. R<->F F<->R flip one of these trains and take it as new parent --->frontpos's will match --true when trains are facing each other. needed on colliding. -- check done by iterating paths and checking their direction --returns nil when not on the same track at all OR when required path items are not generated. this distinction may not always be needed. function advtrains.trains_facing(train1, train2) local sr_pos=train1.path[atround(train1.index)] local sr_pos_p=train1.path[atround(train1.index)-1] for i=advtrains.minN(train2.path), advtrains.maxN(train2.path) do if vector.equals(sr_pos, train2.path[i]) then if train2.path[i+1] and vector.equals(sr_pos_p, train2.path[i+1]) then return true end if train2.path[i-1] and vector.equals(sr_pos_p, train2.path[i-1]) then return false end return nil end end return nil end function advtrains.collide_and_spawn_couple(id1, pos, id2, t1_is_backpos) if minetest.settings:get_bool("advtrains_disable_collisions") then return end atprint("COLLISION: ",sid(id1)," and ",sid(id2)," at ",pos,", t1_is_backpos=",(t1_is_backpos and "true" or "false")) --TODO: local train1=advtrains.trains[id1] -- do collision train1.recently_collided_with_env=true train1.velocity=0.5*train1.velocity train1.movedir=train1.movedir*-1 train1.tarvelocity=0 local train2=advtrains.trains[id2] if not train1 or not train2 then return end local found for i=advtrains.minN(train1.path), advtrains.maxN(train1.path) do if vector.equals(train1.path[i], pos) then found=true end end if not found then atprint("Err: pos not in path. Not spawning a couple") return end local frontpos2=train2.path[atround(train2.detector_old_index)] local backpos2=train2.path[atround(train2.detector_old_end_index)] local t2_is_backpos atprint("End positions: ",frontpos2,backpos2) t2_is_backpos = vector.distance(backpos2, pos) < vector.distance(frontpos2, pos) atprint("t2_is_backpos="..(t2_is_backpos and "true" or "false")) local t1_has_couple, t1_couple_lck if t1_is_backpos then t1_has_couple=train1.couple_eid_back t1_couple_lck=train1.couple_lck_back else t1_has_couple=train1.couple_eid_front t1_couple_lck=train1.couple_lck_front end local t2_has_couple, t2_couple_lck if t2_is_backpos then t2_has_couple=train2.couple_eid_back t2_couple_lck=train2.couple_lck_back else t2_has_couple=train2.couple_eid_front t2_couple_lck=train2.couple_lck_front end if t1_has_couple then if minetest.object_refs[t1_has_couple] then minetest.object_refs[t1_has_couple]:remove() end end if t2_has_couple then if minetest.object_refs[t2_has_couple] then minetest.object_refs[t2_has_couple]:remove() end end if t1_couple_lck or t2_couple_lck then minetest.add_entity(pos, "advtrains:lockmarker") return end local obj=minetest.add_entity(pos, "advtrains:couple") if not obj then atprint("failed creating object") return end local le=obj:get_luaentity() le.train_id_1=id1 le.train_id_2=id2 le.train1_is_backpos=t1_is_backpos le.train2_is_backpos=t2_is_backpos --find in object_refs local p_aoi for aoi, compare in pairs(minetest.object_refs) do if compare==obj then if t1_is_backpos then train1.couple_eid_back=aoi else train1.couple_eid_front=aoi end if t2_is_backpos then train2.couple_eid_back=aoi else train2.couple_eid_front=aoi end p_aoi=aoi end end atprint("Couple spawned (ActiveObjectID ",p_aoi,")") end --order of trains may be irrelevant in some cases. check opposite cases. TODO does this work? --pos1 and pos2 are just needed to form a median. function advtrains.do_connect_trains(first_id, second_id, player) local first, second=advtrains.trains[first_id], advtrains.trains[second_id] if not first or not second or not first.index or not second.index or not first.end_index or not second.end_index then return false end if first.couple_lck_back or second.couple_lck_front then -- trains are ordered correctly! if player then minetest.chat_send_player(player:get_player_name(), "Can't couple: couples locked!") end return end local first_wagoncnt=#first.trainparts local second_wagoncnt=#second.trainparts for _,v in ipairs(second.trainparts) do table.insert(first.trainparts, v) end --kick it like physics (with mass being #wagons) local new_velocity=((first.velocity*first_wagoncnt)+(second.velocity*second_wagoncnt))/(first_wagoncnt+second_wagoncnt) local tmp_cpl_lck=second.couple_lck_back advtrains.trains[second_id]=nil advtrains.update_trainpart_properties(first_id) local train1=advtrains.trains[first_id] train1.velocity=new_velocity train1.tarvelocity=0 train1.couple_eid_front=nil train1.couple_eid_back=nil train1.couple_lck_back=tmp_cpl_lck return true end function advtrains.invert_train(train_id) local train=advtrains.trains[train_id] local old_path=train.path local old_path_dist=train.path_dist train.path={} train.path_dist={} train.index, train.end_index= -train.end_index, -train.index train.path_extent_min, train.path_extent_max = -train.path_extent_max, -train.path_extent_min train.min_index_on_track, train.max_index_on_track = -train.max_index_on_track, -train.min_index_on_track train.detector_old_index, train.detector_old_end_index = -train.detector_old_end_index, -train.detector_old_index train.couple_lck_back, train.couple_lck_front = train.couple_lck_front, train.couple_lck_back train.velocity=-train.velocity train.tarvelocity=-train.tarvelocity for k,v in pairs(old_path) do train.path[-k]=v train.path_dist[-k-1]=old_path_dist[k] end local old_trainparts=train.trainparts train.trainparts={} for k,v in ipairs(old_trainparts) do table.insert(train.trainparts, 1, v)--notice insertion at first place end advtrains.update_trainpart_properties(train_id, true) end function advtrains.get_train_at_pos(pos) return advtrains.detector.get(pos) end function advtrains.invalidate_all_paths(pos) --if a position is given, only invalidate inside a radius to save performance local inv_radius=50 atprint("invalidating all paths") for k,v in pairs(advtrains.trains) do local exec=true if pos and v.path and v.index and v.end_index then --start and end pos of the train local cmp1=v.path[atround(v.index)] local cmp2=v.path[atround(v.end_index)] if vector.distance(pos, cmp1)>inv_radius and vector.distance(pos, cmp2)>inv_radius then exec=false end end if exec then advtrains.invalidate_path(k) end end end function advtrains.invalidate_path(id) local v=advtrains.trains[id] if not v then return end --TODO duplicate code in init.lua avt_save()! if v.index then v.restore_add_index=v.index-math.floor(v.index+1) end v.path=nil v.path_dist=nil v.index=nil v.end_index=nil v.min_index_on_track=nil v.max_index_on_track=nil v.path_extent_min=nil v.path_extent_max=nil v.detector_old_index=nil v.detector_old_end_index=nil end --not blocking trains group function advtrains.train_collides(node) if node and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].walkable then if not minetest.registered_nodes[node.name].groups.not_blocking_trains then return true end end return false end local nonblocknodes={ "default:fence_wood", "default:fence_acacia_wood", "default:fence_aspen_wood", "default:fence_pine_wood", "default:fence_junglewood", "default:torch", "default:sign_wall", "signs:sign_wall", "signs:sign_wall_blue", "signs:sign_wall_brown", "signs:sign_wall_orange", "signs:sign_wall_green", "signs:sign_yard", "signs:sign_wall_white_black", "signs:sign_wall_red", "signs:sign_wall_white_red", "signs:sign_wall_yellow", "signs:sign_post", "signs:sign_hanging", } minetest.after(0, function() for _,name in ipairs(nonblocknodes) do if minetest.registered_nodes[name] then minetest.registered_nodes[name].groups.not_blocking_trains=1 end end end)