Compare commits
	
		
			7 Commits
		
	
	
		
			2b535ee887
			...
			imgbot
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 8c35451f12 | ||
|  | f3ad7ec6f1 | ||
|  | fccd4d8b15 | ||
|  | e5b2cf3a34 | ||
|  | d2608351f6 | ||
|  | a05eae3782 | ||
|  | 2ac90f8d19 | 
| @@ -279,6 +279,11 @@ armor.set_player_armor = function(self, player) | ||||
| 	if use_armor_monoid then | ||||
| 		armor_monoid.monoid:add_change(player, change, "3d_armor:armor") | ||||
| 	else | ||||
| 		-- Preserve immortal group (damage disabled for player) | ||||
| 		local immortal = player:get_armor_groups().immortal | ||||
| 		if immortal and immortal ~= 0 then | ||||
| 			groups.immortal = 1 | ||||
| 		end | ||||
| 		player:set_armor_groups(groups) | ||||
| 	end | ||||
| 	if use_player_monoids then | ||||
|   | ||||
| @@ -99,17 +99,27 @@ armor.formspec = armor.formspec.. | ||||
| if armor.config.fire_protect then | ||||
| 	armor.formspec = armor.formspec.."label[5,2;"..F(S("Fire"))..":  armor_attr_fire]" | ||||
| end | ||||
| armor:register_on_damage(function(player, index, stack) | ||||
| 	local name = player:get_player_name() | ||||
| 	local def = stack:get_definition() | ||||
| 	if name and def and def.description and stack:get_wear() > 60100 then | ||||
| 		minetest.chat_send_player(name, S("Your @1 is almost broken!", def.description)) | ||||
| 		minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0}) | ||||
| 	end | ||||
| end) | ||||
| armor:register_on_destroy(function(player, index, stack) | ||||
| 	local name = player:get_player_name() | ||||
| 	local def = stack:get_definition() | ||||
| 	if name and def and def.description then | ||||
| 		minetest.chat_send_player(name, S("Your @1 got destroyed!", def.description)) | ||||
| 		minetest.sound_play("default_tool_breaks", {to_player = name, gain = 2.0}) | ||||
| 	end | ||||
| end) | ||||
|  | ||||
| local function validate_armor_inventory(player) | ||||
| 	-- Workaround for detached inventory swap exploit | ||||
| 	local _, inv = armor:get_valid_player(player, "[validate_armor_inventory]") | ||||
| 	local pos = player:get_pos() | ||||
| 	if not inv then | ||||
| 		return | ||||
| 	end | ||||
| @@ -140,6 +150,7 @@ local function validate_armor_inventory(player) | ||||
| 				elements[element] = true; | ||||
| 			else | ||||
| 				inv:remove_item("armor", stack) | ||||
| 				minetest.item_drop(stack, player, pos) | ||||
| 				-- The following code returns invalid items to the player's main | ||||
| 				-- inventory but could open up the possibity for a hacked client | ||||
| 				-- to receive items back they never really had. I am not certain | ||||
| @@ -330,8 +341,8 @@ if armor.config.drop == true or armor.config.destroy == true then | ||||
| 		if pos and armor.config.destroy == false then | ||||
| 			minetest.after(armor.config.bones_delay, function() | ||||
| 				local meta = nil | ||||
| 				local maxp = vector.add(pos, 8) | ||||
| 				local minp = vector.subtract(pos, 8) | ||||
| 				local maxp = vector.add(pos, 16) | ||||
| 				local minp = vector.subtract(pos, 16) | ||||
| 				local bones = minetest.find_nodes_in_area(minp, maxp, {"bones:bones"}) | ||||
| 				for _, p in pairs(bones) do | ||||
| 					local m = minetest.get_meta(p) | ||||
|   | ||||
| Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 383 B | 
| Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 399 B | 
| Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 369 B | 
| Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 404 B | 
| Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 376 B | 
| Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 383 B | 
| Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 383 B | 
| Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 399 B | 
| Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 369 B | 
| Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 407 B | 
| Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 382 B | 
| Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 393 B | 
| Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 369 B | 
| Before Width: | Height: | Size: 389 B After Width: | Height: | Size: 377 B | 
| Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 366 B | 
| Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 516 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 446 B | 
| Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 500 B | 
| Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 441 B | 
| Before Width: | Height: | Size: 520 B After Width: | Height: | Size: 504 B | 
| Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 444 B | 
| Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 516 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 446 B | 
| Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 524 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 446 B | 
| Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 508 B | 
| Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 444 B | 
| Before Width: | Height: | Size: 440 B After Width: | Height: | Size: 514 B | 
| Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 446 B | 
| Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 499 B | 
| Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 440 B | 
| Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 453 B | 
| Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 437 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 476 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 386 B | 
| Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 468 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 382 B | 
| Before Width: | Height: | Size: 469 B After Width: | Height: | Size: 464 B | 
| Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 358 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 476 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 386 B | 
| Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 476 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 386 B | 
| Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 491 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 382 B | 
| Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 474 B | 
| Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 382 B | 
| Before Width: | Height: | Size: 478 B After Width: | Height: | Size: 495 B | 
| Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 386 B | 
| Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 462 B | 
| Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 368 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 406 B | 
| Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 399 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 406 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 415 B | 
| Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 409 B | 
| Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 410 B | 
| Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 440 B | 
| Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 438 B | 
| Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 434 B | 
| Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 440 B | 
| Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 440 B | 
| Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 438 B | 
| Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 433 B | 
| Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 438 B | 
| Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 426 B | 
| Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 392 B | 
| Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 389 B | 
| Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 386 B | 
| Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 392 B | 
| Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 392 B | 
| Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 389 B | 
| Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 389 B | 
| Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 400 B | 
| Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 373 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 410 B | 
| Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 420 B | 
| Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 408 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 410 B | 
| Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 410 B | 
| Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 420 B | 
| Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 423 B | 
| Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 420 B | 
| Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 415 B | 
| Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 425 B | 
| Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 394 B | 
| Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 411 B | 
| Before Width: | Height: | Size: 339 B After Width: | Height: | Size: 385 B | 
| Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 406 B | 
| Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 385 B | 
| Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 425 B | 
| Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 389 B |