share/hedgewars/Data/Scripts/SpeedShoppa.lua
changeset 14928 4c5fb1ee75b7
parent 14760 75bd27700837
child 15014 f877fbeaee6c
equal deleted inserted replaced
14927:9d6a25239d00 14928:4c5fb1ee75b7
   175 				SendStat(siPlayerKills, tostring(cratesCollected), GetHogTeamName(playerHog))
   175 				SendStat(siPlayerKills, tostring(cratesCollected), GetHogTeamName(playerHog))
   176 				SendStat(siCustomAchievement, string.format(loc("You have collected %d out of %d crate(s)."), cratesCollected, #crates))
   176 				SendStat(siCustomAchievement, string.format(loc("You have collected %d out of %d crate(s)."), cratesCollected, #crates))
   177 			end
   177 			end
   178 			gameEnded = true
   178 			gameEnded = true
   179 			EndGame()
   179 			EndGame()
       
   180 			if cratesCollected == #crates then
       
   181 				SetState(playerHog, gstWinner)
       
   182 			end
   180 		end
   183 		end
   181 	end
   184 	end
   182 
   185 
   183 	_G.spawnCrate = function(x, y)
   186 	_G.spawnCrate = function(x, y)
   184 		if params.crateType == "utility" then
   187 		if params.crateType == "utility" then