share/hedgewars/Data/Scripts/TargetPractice.lua
changeset 12430 f9cbb896967b
parent 12429 b9cc405541c1
child 12785 659ab77b52c0
equal deleted inserted replaced
12429:b9cc405541c1 12430:f9cbb896967b
   231 		end
   231 		end
   232 	end
   232 	end
   233 
   233 
   234 	_G.onGearDelete = function(gear)
   234 	_G.onGearDelete = function(gear)
   235 		if GetGearType(gear) == gtTarget and band(GetState(gear), gstDrowning) ~= 0 then
   235 		if GetGearType(gear) == gtTarget and band(GetState(gear), gstDrowning) ~= 0 then
   236 			AddCaption(loc("You lost your target, try again!", 0xFFFFFFFF, capgrpGameState))
   236 			AddCaption(loc("You lost your target, try again!"), 0xFFFFFFFF, capgrpGameState)
   237 			local newTarget = spawnTarget()
   237 			local newTarget = spawnTarget()
   238 			local x, y = GetGearPosition(newTarget)
   238 			local x, y = GetGearPosition(newTarget)
   239 			local success = PlaceSprite(x, y + 24, sprAmGirder, 0, 0xFFFFFFFF, false, false, false)
   239 			local success = PlaceSprite(x, y + 24, sprAmGirder, 0, 0xFFFFFFFF, false, false, false)
   240 			if not success then
   240 			if not success then
   241 				WriteLnToConsole("ERROR: Failed to spawn girder under respawned target!")
   241 				WriteLnToConsole("ERROR: Failed to spawn girder under respawned target!")