# HG changeset patch # User unc0rr # Date 1380566808 -14400 # Node ID 14ad1ac00ac9e3af66977111890fb8690d6d03e8 # Parent fbf61ef67c7be60cf358b7394ee90637b30fa1cd Modify Racer script so it could work with special points diff -r fbf61ef67c7b -r 14ad1ac00ac9 QTfrontend/drawmapscene.cpp --- a/QTfrontend/drawmapscene.cpp Mon Sep 30 13:43:55 2013 -0400 +++ b/QTfrontend/drawmapscene.cpp Mon Sep 30 22:46:48 2013 +0400 @@ -193,6 +193,8 @@ removeItem(items().first()); } + items().clear(); + oldPaths = paths; paths.clear(); diff -r fbf61ef67c7b -r 14ad1ac00ac9 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Mon Sep 30 13:43:55 2013 -0400 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Mon Sep 30 22:46:48 2013 +0400 @@ -92,6 +92,10 @@ local currY = {} local currCount = 0 +local specialPointsX = {} +local specialPointsY = {} +local specialPointsCount = 0 + -------------------------- -- hog and team tracking variales -------------------------- @@ -489,6 +493,10 @@ lastRound = TotalRounds RoundHasChanged = false -- true + for i = 0, (specialPointsCount-1) do + PlaceWayPoint(specialPointsX[i], specialPointsY[i]) + end + RebuildTeamInfo() ShowMission ( @@ -501,7 +509,7 @@ "", 4, 4000 ) - TryRepositionHogs() + TryRepositionHogs() end @@ -525,13 +533,15 @@ end function onSpecialPoint(x,y,flag) - PlaceWayPoint(x,y) + specialPointsX[specialPointsCount] = x + specialPointsY[specialPointsCount] = y + specialPointsCount = specialPointsCount + 1 end function onNewTurn() CheckForNewRound() - TryRepositionHogs() + TryRepositionHogs() racerActive = false