Graf, when can we have global lines and sectors arrays? Even dynamic arrays are done already...
(sorry in case I simply didn't notice, global variables aren't something that can be easily seen in the ZScript files)
(and I'd like BlockLinesIterator, too)
That really blocks any experiments/research on implementing proper pathfinding that'd also work with reasonable speed.
Edit: nevermind. Found the relevant stuff. For anyone else who's also interested:
Code: Select all
// Add the game data arrays to LevelLocals.
lstruct->AddNativeField("sectors", NewPointer(NewResizableArray(sectorstruct), false), myoffsetof(FLevelLocals, sectors), VARF_Native);
lstruct->AddNativeField("lines", NewPointer(NewResizableArray(linestruct), false), myoffsetof(FLevelLocals, lines), VARF_Native);
lstruct->AddNativeField("sides", NewPointer(NewResizableArray(sidestruct), false), myoffsetof(FLevelLocals, sides), VARF_Native);
lstruct->AddNativeField("vertexes", NewPointer(NewResizableArray(vertstruct), false), myoffsetof(FLevelLocals, vertexes), VARF_Native|VARF_ReadOnly);
lstruct->AddNativeField("sectorportals", NewPointer(NewResizableArray(sectorportalstruct), false), myoffsetof(FLevelLocals, sectorPortals), VARF_Native);
@Graf: play/ui scope is not added automatically. In the compiler, it's added to VARF_ of the field if the class has the relevant OF_ flag. AddNativeField probably doesn't do that, so it needs to be fixed, otherwise your manually added complex type fields will end up being world-accessible.
Although here it doesn't matter much because the sectors themselves (and vertices, and lines, and other stuff) is flagged as play.