View Issue Details

IDProjectCategoryView StatusLast Update
0002467Spring engineLuapublic2011-06-21 21:22
Reporterabma Assigned Toabma  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.82.7+git 
Target Version83.0 
Summary0002467: Remove remaining .n's
Descriptionand break more lua-code...

this will improve performance, cleanup & simplify coding. (at least i hope so...)
Additional Informationsee minutes:
http://springrts.com/phpbb/viewtopic.php?f=12&t=26199
TagsNo tags attached.
Checked infolog.txt for Errors

Relationships

has duplicate 0002456 resolvedabma (master) morphing doesn't work 

Activities

abma

2011-06-12 04:53

administrator   ~0006731

Last edited: 2011-06-12 04:54

I'm unsure if this are all places where it needs to be removed:

rts/Lua $ grep -R \"n\" .
./LuaRules.cpp: HSTR_PUSH_NUMBER(L, "n", cmd.params.size());
./LuaUnitDefs.cpp: HSTR_PUSH_NUMBER(L, "n", count);
./LuaUnitDefs.cpp: HSTR_PUSH_NUMBER(L, "n", weaponCount);
./LuaUnitDefs.cpp: HSTR_PUSH_NUMBER(L, "n", soundCount);
./LuaSyncedRead.cpp:static const LuaHashString hs_n("n");
./LuaSyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", localModel->pieces.size());
./LuaSyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", op.childs.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", count);
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", v.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", unitDefMap.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", countMap.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", cmdDescCount);
./LuaUnsyncedRead.cpp: lua_pushstring(L, "n");
./LuaUnsyncedRead.cpp: lua_pushstring(L, "n");
./LuaUnsyncedRead.cpp: lua_pushstring(L, "n");
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", count);
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", v.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", unitDefMap.size());
./LuaUnsyncedRead.cpp: HSTR_PUSH_NUMBER(L, "n", countMap.size());
./LuaWeaponDefs.cpp: HSTR_PUSH_NUMBER(L, "n", soundCount);
./LuaOpenGL.cpp: else if ((key == "n") || (key == "normal")) {
./LuaUtils.cpp: if (dir == "n") { return 2; }
./LuaUtils.cpp: // params["n"] = numParams
./LuaUtils.cpp: HSTR_PUSH_NUMBER(L, "n", numParams);
./LuaVFS.cpp: lua_pushstring(L, "n");

abma

2011-06-12 05:16

administrator   ~0006732

Last edited: 2011-06-12 05:17

major priority because this breaks many lua-scripts... for example the morphing-script is affected. these should be replaced before a release.

FLOZi

2011-06-12 15:12

reporter   ~0006735

morphing script is easy to fix as the place .n is used is with an array, so # operator can be used instead.

Less nice is if there are any situations where maps are returned by the engine. Only way to count their elements without .n is to use a loop with pairs(), which can be slow, especially for large tables.

abma

2011-06-21 21:22

administrator   ~0006799

thanks hoijui!

https://github.com/spring/spring/commit/1874b58f97d7cfab84decdb4ff5f36a810fa9336

Issue History

Date Modified Username Field Change
2011-06-12 04:47 abma New Issue
2011-06-12 04:47 abma Graphics Card => unknown
2011-06-12 04:48 abma Target Version => 0.83.0
2011-06-12 04:51 abma Relationship added has duplicate 0002456
2011-06-12 04:53 abma Note Added: 0006731
2011-06-12 04:54 abma Note Edited: 0006731
2011-06-12 05:16 abma Note Added: 0006732
2011-06-12 05:16 abma Severity tweak => major
2011-06-12 05:17 abma Note Edited: 0006732
2011-06-12 15:12 FLOZi Note Added: 0006735
2011-06-21 21:22 abma Note Added: 0006799
2011-06-21 21:22 abma Status new => resolved
2011-06-21 21:22 abma Resolution open => fixed
2011-06-21 21:22 abma Assigned To => abma