aboutsummaryrefslogtreecommitdiff
path: root/cmake
Commit message (Expand)AuthorAge
* Fix find_path for newer jsoncpp installationsWilliam Breathitt Gray2019-11-17
* Find LuaJIT headers on vcpkgUnknown2019-08-18
* Clean up FindOpenGLES2.cmakesfan52019-08-04
* Add compatibility to vcpkg buildsystem (#8317)adrido2019-06-10
* DragonFly BSD is somewhat identical to FreeBSD (#8159)Leonid Bobrov2019-02-03
* Fix libgmp detection (#7488)Leonid Bobrov2018-06-26
* Fix luajit include not being foundrubenwardy2018-05-08
* Initial Haiku support (#6568)miqlas2017-10-30
* Fix cmake library default build problem since moving to lib/Loic Blot2017-04-07
* Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instea...Loïc Blot2017-04-02
* Fixes for compiling with a newer (system) jsoncpp (#4429)Rogier-52016-08-10
* Really fix ncurses lookup on Arch Linuxsfan52016-05-16
* Fix ncurses lookup on Arch LinuxDavid Knapp2016-04-08
* Improve LuaJIT detectionFerdinand Thiessen2015-12-05
* Add server side ncurses terminalest312015-11-06
* FindJson: use PATH_SUFFIXES jsoncpp to find incdirIgor Gnatenko2015-09-26
* Add LibGMPest312015-05-11
* Make Git version detection use VERSION_STRING instead of tagsShadowNinja2015-05-05
* Better version detection for shallow clonesest312015-05-03
* Fix typo in OpenGL ES 2 CMake fileShadowNinja2015-03-27
* Clean up and tweak build systemShadowNinja2015-03-27
* Fix cmake po detection bugest312015-03-23
* Improve FindIrrlicht.cmake moduleMarkus Koschany2015-02-21
* Remove included SQLite3ShadowNinja2015-01-08
* OS X compatibility fixesMartin Doege2014-06-29
* Add CURL_DLL search to show up CURL_DLL in cmake gui and don't silently ignor...sapier2013-11-17
* Show git hash in version string at top left corner of windowKahrl2013-09-28
* Always use builtin JThread librarykwolekr2013-09-15
* build with ogles2 driverproller2013-03-16
* fix link if system json lib existsproller2013-03-05
* new auto masterserverproller2013-02-22
* Prefer shared cURL library instead of the static one.Ilya Zhuravlev2012-12-21
* Tweak CMake files for cURLsfan52012-12-18
* Added ability to fetch media from remote server (using cURL library)Ilya Zhuravlev2012-12-16
* Add OGG_INCLUDE_DIR to SOUND_INCLUDE_DIRSPerttu Ahola2012-03-25
* celeron55's sound system initial frameworkPerttu Ahola2012-03-24
* Flatten share/ and user/ in the source and for the RUN_IN_PLACE buildPerttu Ahola2012-03-20
* Gettext fix for *BSD - require special linkage as glibc is not usedq662011-08-11
* Locale dir should be parallel to global data dirGiuseppe Bilotta2011-07-24
* Bring po update out of cmake againGiuseppe Bilotta2011-07-24
* updated cmakerules to autodetect if gettext can be usedConstantin Wenger2011-07-23
* updatepo cmake ruleGiuseppe Bilotta2011-07-22
* Refactor mo creation/installationGiuseppe Bilotta2011-07-22
* fixed not finding dll for gettext in MSVCConstantin Wenger2011-07-21
* Find correct library for MSVC vs MingW in WinowsGiuseppe Bilotta2011-07-21
* updated some path because the dlls are mostly under bin not libConstantin Wenger2011-07-21
* Refactor and clean up gettext managementGiuseppe Bilotta2011-07-21
* Use system sqlite3/jthread libs if availableGiuseppe Bilotta2011-07-20
* Added libIrrlicht.dll.a to searched library names for non-MSVC windowsPerttu Ahola2011-05-17
* forgot some test code in...Perttu Ahola2011-02-16
max() local count = math.min(stack:get_count(), max_count) local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3) local coll_height = size * 0.75 self.object:set_properties({ is_visible = true, visual = "wielditem", textures = {itemname}, visual_size = {x = size, y = size}, collisionbox = {-size, -coll_height, -size, size, coll_height, size}, selectionbox = {-size, -size, -size, size, size, size}, automatic_rotate = math.pi * 0.5 * 0.2 / size, wield_item = self.itemstring, }) end, get_staticdata = function(self) return core.serialize({ itemstring = self.itemstring, age = self.age, dropped_by = self.dropped_by }) end, on_activate = function(self, staticdata, dtime_s) if string.sub(staticdata, 1, string.len("return")) == "return" then local data = core.deserialize(staticdata) if data and type(data) == "table" then self.itemstring = data.itemstring self.age = (data.age or 0) + dtime_s self.dropped_by = data.dropped_by end else self.itemstring = staticdata end self.object:set_armor_groups({immortal = 1}) self.object:set_velocity({x = 0, y = 2, z = 0}) self.object:set_acceleration({x = 0, y = -gravity, z = 0}) self:set_item() end, try_merge_with = function(self, own_stack, object, entity) if self.age == entity.age then -- Can not merge with itself return false end local stack = ItemStack(entity.itemstring) local name = stack:get_name() if own_stack:get_name() ~= name or own_stack:get_meta() ~= stack:get_meta() or own_stack:get_wear() ~= stack:get_wear() or own_stack:get_free_space() == 0 then -- Can not merge different or full stack return false end local count = own_stack:get_count() local total_count = stack:get_count() + count local max_count = stack:get_stack_max() if total_count > max_count then return false end -- Merge the remote stack into this one local pos = object:get_pos() pos.y = pos.y + ((total_count - count) / max_count) * 0.15 self.object:move_to(pos) self.age = 0 -- Handle as new entity own_stack:set_count(total_count) self:set_item(own_stack) entity.itemstring = "" object:remove() return true end, on_step = function(self, dtime) self.age = self.age + dtime if time_to_live > 0 and self.age > time_to_live then self.itemstring = "" self.object:remove() return end local pos = self.object:get_pos() local node = core.get_node_or_nil({ x = pos.x, y = pos.y + self.object:get_properties().collisionbox[2] - 0.05, z = pos.z }) -- Delete in 'ignore' nodes if node and node.name == "ignore" then self.itemstring = "" self.object:remove() return end local vel = self.object:get_velocity() local def = node and core.registered_nodes[node.name] local is_moving = (def and not def.walkable) or vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0 local is_slippery = false if def and def.walkable then local slippery = core.get_item_group(node.name, "slippery") is_slippery = slippery ~= 0 if is_slippery and (math.abs(vel.x) > 0.2 or math.abs(vel.z) > 0.2) then -- Horizontal deceleration local slip_factor = 4.0 / (slippery + 4) self.object:set_acceleration({ x = -vel.x * slip_factor, y = 0, z = -vel.z * slip_factor }) elseif vel.y == 0 then is_moving = false end end if self.moving_state == is_moving and self.slippery_state == is_slippery then -- Do not update anything until the moving state changes return end self.moving_state = is_moving self.slippery_state = is_slippery if is_moving then self.object:set_acceleration({x = 0, y = -gravity, z = 0}) else self.object:set_acceleration({x = 0, y = 0, z = 0}) self.object:set_velocity({x = 0, y = 0, z = 0}) end --Only collect items if not moving if is_moving then return end -- Collect the items around to merge with local own_stack = ItemStack(self.itemstring) if own_stack:get_free_space() == 0 then return end local objects = core.get_objects_inside_radius(pos, 1.0) for k, obj in pairs(objects) do local entity = obj:get_luaentity() if entity and entity.name == "__builtin:item" then if self:try_merge_with(own_stack, obj, entity) then own_stack = ItemStack(self.itemstring) if own_stack:get_free_space() == 0 then return end end end end end, on_punch = function(self, hitter) local inv = hitter:get_inventory() if inv and self.itemstring ~= "" then local left = inv:add_item("main", self.itemstring) if left and not left:is_empty() then self:set_item(left) return end end self.itemstring = "" self.object:remove() end, })