Mercurial > sumwars
changeset 2722:fcdd285aeed8
refs #116: Fix to the removed lua.5.2 getn method.
author | vyproyects@gmail.com |
---|---|
date | Wed, 25 Jun 2014 20:38:00 +0200 |
parents | ec0676c7fb57 |
children | 705895cac848 |
files | share/data/lua/locgenerate.lua share/data/lua/party.lua share/data/quests/fortify_dwarfenwall.xml share/data/quests/tutorial.xml |
diffstat | 4 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/share/data/lua/locgenerate.lua Sun Jun 08 10:33:19 2014 +0200 +++ b/share/data/lua/locgenerate.lua Wed Jun 25 20:38:00 2014 +0200 @@ -4,7 +4,7 @@ angle = angle or 0; arcangle = arcangle or 120; number = number or 1; - local n = table.getn(locations); + local n = #locations; local inc = arcangle / (number); local angl = angle - 0.5*arcangle + inc*0.5; local i; @@ -28,7 +28,7 @@ local i,j local x,y; local jmax; - local n = table.getn(locations); + local n = #locations; for i=1,dim2 do x = ((dim2+1)/2 - i)*dist; jmax = math.min(number,dim); @@ -45,4 +45,4 @@ function getNextTileCenter(vec) vec[1] = math.floor(vec[1]/8) * 8 + 4; vec[2] = math.floor(vec[2]/8) * 8 + 4; -end; \ No newline at end of file +end;
--- a/share/data/lua/party.lua Sun Jun 08 10:33:19 2014 +0200 +++ b/share/data/lua/party.lua Wed Jun 25 20:38:00 2014 +0200 @@ -74,7 +74,7 @@ if (radius == nil) then radius = math.sqrt(dir[1]*dir[1] + dir[2]*dir[2]); end; - generateArc(loc,lookatloc,radius,table.getn(objects),arcangle,angle); + generateArc(loc,lookatloc,radius,#objects,arcangle,angle); -- zweimal ausfuehren, weil beim ersten Mal haeuffig noch Verdraengung stattfindet for i,obj in ipairs(objects) do @@ -184,4 +184,4 @@ count = count + 1 end return count -end; \ No newline at end of file +end;
--- a/share/data/quests/fortify_dwarfenwall.xml Sun Jun 08 10:33:19 2014 +0200 +++ b/share/data/quests/fortify_dwarfenwall.xml Wed Jun 25 20:38:00 2014 +0200 @@ -506,7 +506,7 @@ <Effect> setCutsceneMode(false); fortify_dwall_tmp.elemental = createObject("fireElemS","locElemental"); - fortify_dwall_tmp.playernr = table.getn(getPlayers()); + fortify_dwall_tmp.playernr = #getPlayers(); fortify_dwall_tmp.inactive_pl = {}; fortify_dwall_tmp.inactive_pl_nr = 0; fortify_dwall_tmp.inactive_pl_wall = {};
--- a/share/data/quests/tutorial.xml Sun Jun 08 10:33:19 2014 +0200 +++ b/share/data/quests/tutorial.xml Wed Jun 25 20:38:00 2014 +0200 @@ -1159,7 +1159,7 @@ setCutsceneMode(true) addCameraPosition(0,"locBackroute2" , -120,40, 20); tutorial_tmp.slugs = createMonsterGroup("tutorialMutantSlugs","locBackroute3",3); - tutorial_tmp.slugnr = table.getn(tutorial_tmp.slugs); + tutorial_tmp.slugnr = #tutorial_tmp.slugs; timedExecute("door_toggle('slugFarmFoodDoor')",1000); startTimer("go_backroute2",2000);